Explorar o código

1.财务结算管理 金额调整 导入调整
时间查询条件调整

wuhp %!s(int64=2) %!d(string=hai) anos
pai
achega
e729710a23

+ 8 - 2
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -91,6 +91,12 @@ public class InsPlyIncomeController extends BaseController {
         List<InsPlyIncome>  result = insPlyIncomeService.totalPinAmount(insPlyIncomeVo);
         List<InsPlyIncome>  result = insPlyIncomeService.totalPinAmount(insPlyIncomeVo);
         return  HttpResult.ok(result);
         return  HttpResult.ok(result);
     }
     }
+    @PostMapping("/bxTotalAmount")
+    @ApiModelProperty(value = "保险手续费合计")
+    public HttpResult<InsPlyIncome>bxTotalPinAmount(@RequestBody @Valid InsPlyIncomeVo insPlyIncomeVo){
+        InsPlyIncome  result = insPlyIncomeService.bxTotalAmount(insPlyIncomeVo);
+        return  HttpResult.ok(result);
+    }
     @PutMapping("/balance")
     @PutMapping("/balance")
     @ApiModelProperty(value = "结算手续费")
     @ApiModelProperty(value = "结算手续费")
     public HttpResult<Object> balance(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
     public HttpResult<Object> balance(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
@@ -140,9 +146,9 @@ public class InsPlyIncomeController extends BaseController {
     @ApiImplicitParams({
     @ApiImplicitParams({
             @ApiImplicitParam(name = "file", value = "excel文件", required = true, dataType = "__file")
             @ApiImplicitParam(name = "file", value = "excel文件", required = true, dataType = "__file")
     })
     })
-    public HttpResult importData(@RequestPart MultipartFile file , @RequestBody InsPlyIncomeVo  insPlyIncomeVo ) {
+    public HttpResult importData(@RequestParam MultipartFile MultipartFile) {
 
 
-        insPlyIncomeService.importData(file,insPlyIncomeVo);
+        insPlyIncomeService.importData(MultipartFile);
 
 
         return HttpResult.ok("导入成功");
         return HttpResult.ok("导入成功");
     }
     }

+ 5 - 1
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -96,5 +96,9 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
     List<InsPlyIncome> allOtherAmount(HashMap<String, Object> params);
     List<InsPlyIncome> allOtherAmount(HashMap<String, Object> params);
 
 
 
 
-    InsPlyIncome findByLicenseno(@Param ("licenseno")String licenseno, @Param ("policyno") String policyno, @Param ("syPolicyno") String syPolicyno,@Param ("noPolicyno")   String noPolicyno);
+    List<InsPlyIncome> findByLicenseno(HashMap<String, Object> params);
+
+    InsPlyIncome bxTotalAmount(HashMap<String, Object> params);
+
+
 }
 }

+ 1 - 0
src/main/java/com/ydtech/modules/fnc/entity/InsAreaCompany.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;

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

@@ -128,7 +128,7 @@ public class InsPlyIncome implements Serializable {
 
 
     @ApiModelProperty("记录插入时间")
     @ApiModelProperty("记录插入时间")
     @TableField("create_time")
     @TableField("create_time")
-    private LocalDateTime createTime;
+    private LocalDate createTime;
 
 
     @ApiModelProperty("开票时间")
     @ApiModelProperty("开票时间")
     @TableField("invoic_time")
     @TableField("invoic_time")
@@ -136,11 +136,11 @@ public class InsPlyIncome implements Serializable {
 
 
     @ApiModelProperty("结算日期")
     @ApiModelProperty("结算日期")
     @TableField("settlement_time")
     @TableField("settlement_time")
-    private LocalDateTime settlementTime;
+    private LocalDate settlementTime;
 
 
     @ApiModelProperty("修改日期")
     @ApiModelProperty("修改日期")
     @TableField("update_time")
     @TableField("update_time")
-    private LocalDateTime updateTime;
+    private LocalDate updateTime;
 
 
     @ApiModelProperty("结算人")
     @ApiModelProperty("结算人")
     @TableField("settlement_user_id")
     @TableField("settlement_user_id")
@@ -329,7 +329,7 @@ public class InsPlyIncome implements Serializable {
 
 
     @ApiModelProperty("跟单费结算金额")
     @ApiModelProperty("跟单费结算金额")
     @TableField(exist = false)
     @TableField(exist = false)
-    private BigDecimal settlementAmount;
+    private BigDecimal settleMentAmount;
 
 
     @ApiModelProperty("跟单费未结算金额")
     @ApiModelProperty("跟单费未结算金额")
     @TableField(exist = false)
     @TableField(exist = false)
@@ -353,7 +353,7 @@ public class InsPlyIncome implements Serializable {
     private String monthSigdate;
     private String monthSigdate;
 
 
 
 
-    @ApiModelProperty("结算手续费")
+    @ApiModelProperty("已开票已结算手续费")
     @TableField(exist = false)
     @TableField(exist = false)
     private BigDecimal readyCommissionFeevalue;
     private BigDecimal readyCommissionFeevalue;
     @ApiModelProperty("未结算跟单费")
     @ApiModelProperty("未结算跟单费")
@@ -374,7 +374,7 @@ public class InsPlyIncome implements Serializable {
     private String incomeIds;
     private String incomeIds;
 
 
 
 
-    public InsPlyIncome(String orderno, String policyno, String syPolicyno, String noPolicyno, String settleno, String deptId, String deptName, String riskcode, LocalDateTime payDate, LocalDateTime signDate, String companyId, String companyName, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal noTaxPremium, BigDecimal commissionFeerate, BigDecimal otherFeerate, BigDecimal commissionFeevalue, BigDecimal otherFeevalue, BigDecimal allFeeValue, BigDecimal finalFeeValue, BigDecimal doingFeeValue, LocalDateTime createTime, String voucherNumber, String contractId, String contractFileId, String handlingFeesStatus, String documentaryFeesStatus, String isNotCar, String isNotDocumentary) {
+    public InsPlyIncome(String orderno, String policyno, String syPolicyno, String noPolicyno, String settleno, String deptId, String deptName, String riskcode, LocalDateTime payDate, LocalDateTime signDate, String companyId, String companyName, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal noTaxPremium, BigDecimal commissionFeerate, BigDecimal otherFeerate, BigDecimal commissionFeevalue, BigDecimal otherFeevalue, BigDecimal allFeeValue, BigDecimal finalFeeValue, BigDecimal doingFeeValue, LocalDate createTime, String voucherNumber, String contractId, String contractFileId, String handlingFeesStatus, String documentaryFeesStatus, String isNotCar, String isNotDocumentary) {
         this.orderno = orderno;
         this.orderno = orderno;
         this.policyno = policyno;
         this.policyno = policyno;
         this.syPolicyno = syPolicyno;
         this.syPolicyno = syPolicyno;
@@ -408,6 +408,6 @@ public class InsPlyIncome implements Serializable {
         this.isNotDocumentary = isNotDocumentary;
         this.isNotDocumentary = isNotDocumentary;
     }
     }
 
 
-    public InsPlyIncome(String id, String jqpolicyno, String sypolicyno, Object o, Object o1, String deptId, Object o2, String productid, LocalDateTime payDate, LocalDateTime signingTime, String companyId, Object o3, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal allNoTaxPremium, BigDecimal handlingProportion, Object o4, BigDecimal handlingAmount, BigDecimal handlingAmount1, Object o5, Object o6, LocalDateTime now, Object o7, Object o8, Object o9, String number, String number1, String number2, String number3) {
+    public InsPlyIncome(String id, String jqpolicyno, String sypolicyno, Object o, Object o1, String deptId, Object o2, String productid, LocalDate payDate, LocalDate signingTime, String companyId, Object o3, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal allNoTaxPremium, BigDecimal handlingProportion, Object o4, BigDecimal handlingAmount, BigDecimal handlingAmount1, Object o5, Object o6, LocalDate now, Object o7, Object o8, Object o9, String number, String number1, String number2, String number3) {
     }
     }
 }
 }

+ 4 - 0
src/main/java/com/ydtech/modules/fnc/entity/SettlementDocumentaryFeesEntity.java

@@ -81,6 +81,10 @@ public class SettlementDocumentaryFeesEntity implements Serializable {
     @TableField("ids")
     @TableField("ids")
     private String ids;
     private String ids;
 
 
+    @ApiModelProperty("是否是开票 结算")
+    @TableField("settlement_status")
+    private String settlementStatus;
+
 
 
 
 
 
 

+ 3 - 1
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -45,7 +45,7 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult<List<InsPlyIncome>> nonSettldetail(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<List<InsPlyIncome>> nonSettldetail(InsPlyIncomeVo insPlyIncomeVo);
 
 
 
 
-    void importData(MultipartFile file, InsPlyIncomeVo insPlyIncomeVo);
+    void importData(MultipartFile MultipartFile);
 
 
     void updateByEntity(InsPlyIncomeVo insPlyIncomeVo);
     void updateByEntity(InsPlyIncomeVo insPlyIncomeVo);
 
 
@@ -79,4 +79,6 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult bxHandlingexcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
     HttpResult bxHandlingexcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
 
 
     HttpResult bxOtherExcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
     HttpResult bxOtherExcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
+
+    InsPlyIncome bxTotalAmount(InsPlyIncomeVo insPlyIncomeVo);
 }
 }

+ 2 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsFeeAuditServiceImpl.java

@@ -41,6 +41,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Date;
@@ -691,7 +692,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setPayDate(StringUtils.isNullOrEmpty(plyDto.getPayDate())?plyDto.getCreatetime():plyDto.getPayDate());
         insPlyIncome.setPayDate(StringUtils.isNullOrEmpty(plyDto.getPayDate())?plyDto.getCreatetime():plyDto.getPayDate());
         insPlyIncome.setSignDate(StringUtils.isNullOrEmpty(plyDto.getInsidePayTime())?plyDto.getPayDate():plyDto.getInsidePayTime());
         insPlyIncome.setSignDate(StringUtils.isNullOrEmpty(plyDto.getInsidePayTime())?plyDto.getPayDate():plyDto.getInsidePayTime());
-        insPlyIncome.setCreateTime(LocalDateTime.now() );
+        insPlyIncome.setCreateTime(LocalDate.now() );
         if(StringUtils.isNotEmpty(plyDto.getJqpolicyno())){
         if(StringUtils.isNotEmpty(plyDto.getJqpolicyno())){
             insPlyIncome.setPolicyno(plyDto.getJqpolicyno());
             insPlyIncome.setPolicyno(plyDto.getJqpolicyno());
             insPlyIncome.setRiskcode("交强");
             insPlyIncome.setRiskcode("交强");

+ 42 - 22
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -174,7 +174,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setAgreementId(insFeeOrderNew.getAgreementId());
         insPlyIncome.setAgreementId(insFeeOrderNew.getAgreementId());
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setTaxamount(insAreaCompany.getTaxamount());
         insPlyIncome.setTaxamount(insAreaCompany.getTaxamount());
-        insPlyIncome.setCreateTime(LocalDateTime.now());
+        insPlyIncome.setCreateTime(LocalDate.now());
         insPlyIncome.setDocumentaryFeesStatus("0");
         insPlyIncome.setDocumentaryFeesStatus("0");
         insPlyIncome.setHandlingFeesStatus("0");
         insPlyIncome.setHandlingFeesStatus("0");
         insPlyIncome.setNoNoTaxPremium(insPlyIncome.getNoNoTaxPremium());
         insPlyIncome.setNoNoTaxPremium(insPlyIncome.getNoNoTaxPremium());
@@ -203,7 +203,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setAgreementId(insFeeOrderNew.getAgreementId());
         insPlyIncome.setAgreementId(insFeeOrderNew.getAgreementId());
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setTaxamount(insAreaCompany.getTaxamount());
         insPlyIncome.setTaxamount(insAreaCompany.getTaxamount());
-        insPlyIncome.setCreateTime(LocalDateTime.now());
+        insPlyIncome.setCreateTime(LocalDate.now());
         insPlyIncome.setDocumentaryFeesStatus("0");
         insPlyIncome.setDocumentaryFeesStatus("0");
         insPlyIncome.setHandlingFeesStatus("0");
         insPlyIncome.setHandlingFeesStatus("0");
         insPlyIncome.setIsNotCar("1");
         insPlyIncome.setIsNotCar("1");
@@ -225,7 +225,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
 
 
 
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,insFeeOrderNew.getDeptId(),null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,insFeeOrderNew.getDeptId(),null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),
-                allNoTaxPremium,null,otherProportion,null,otherAmount,otherAmount,null,null,LocalDateTime.now(),null,null,null,"0","0","0","1");
+                allNoTaxPremium,null,otherProportion,null,otherAmount,otherAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","1");
 
 
         insPlyIncome.setTaxPremium(allPremium);
         insPlyIncome.setTaxPremium(allPremium);
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
@@ -248,7 +248,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         BigDecimal handlingProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(), insFeeOrderNew.getSySuperviseCostsProportion(),null);
         BigDecimal handlingProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(), insFeeOrderNew.getSySuperviseCostsProportion(),null);
         BigDecimal allNoTaxPremium = this.calculateTotal(insFeeOrderNew.getJqNoTaxPremium(), insFeeOrderNew.getSyNoTaxPremium(), null);//不含税保费
         BigDecimal allNoTaxPremium = this.calculateTotal(insFeeOrderNew.getJqNoTaxPremium(), insFeeOrderNew.getSyNoTaxPremium(), null);//不含税保费
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,insFeeOrderNew.getDeptId(),null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount()
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,insFeeOrderNew.getDeptId(),null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount()
-        ,allNoTaxPremium,handlingProportion,null,handlingAmount,null,handlingAmount,null,null,LocalDateTime.now(),null,null,null,"0","0","0","0");
+        ,allNoTaxPremium,handlingProportion,null,handlingAmount,null,handlingAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","0");
         BigDecimal allTaxPremium = this.calculateTotal(insFeeOrderNew.getJqPremium(), insFeeOrderNew.getSyPremium(), null);
         BigDecimal allTaxPremium = this.calculateTotal(insFeeOrderNew.getJqPremium(), insFeeOrderNew.getSyPremium(), null);
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
         insPlyIncome.setSyPremium(insFeeOrderNew.getSyPremium());
         insPlyIncome.setSyPremium(insFeeOrderNew.getSyPremium());
@@ -309,7 +309,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),
                 noPolicyno,null,insFeeOrderNew.getDeptId(), null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),
                 noPolicyno,null,insFeeOrderNew.getDeptId(), null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),
                 null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),allNoTaxPremium,handlingProportion,
                 null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),allNoTaxPremium,handlingProportion,
-                otherProportion,handlingAmount,otherAmount,allAmount,null,null,LocalDateTime.now(),null,null,null,"0","0","0","0");
+                otherProportion,handlingAmount,otherAmount,allAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","0");
         insPlyIncome.setJqReceivableProportion(jqReceivableProportion);
         insPlyIncome.setJqReceivableProportion(jqReceivableProportion);
         insPlyIncome.setSyReceivableProportion(syReceivableProportion);
         insPlyIncome.setSyReceivableProportion(syReceivableProportion);
         insPlyIncome.setNoReceivableProportion(noReceivableProportion);
         insPlyIncome.setNoReceivableProportion(noReceivableProportion);
@@ -411,11 +411,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         InsPlyIncome noTotalAmount =baseMapper.totalAmount(params);
         InsPlyIncome noTotalAmount =baseMapper.totalAmount(params);
         if(ObjectUtils.isNotEmpty(totalledAmount) && ObjectUtils.isNotEmpty(noTotalAmount)){
         if(ObjectUtils.isNotEmpty(totalledAmount) && ObjectUtils.isNotEmpty(noTotalAmount)){
             totalledAmount.setReadyTotalFeevalue(noTotalAmount.getTotalFeevalue());
             totalledAmount.setReadyTotalFeevalue(noTotalAmount.getTotalFeevalue());
-            totalledAmount.setReadyCommissionFeevalue(noTotalAmount.getReadyCommissionFeevalue());
+            totalledAmount.setReadyCommissionFeevalue(noTotalAmount.getCommissionFeevalue());
             totalledAmount.setReadyOtherFeevalue(noTotalAmount.getOtherFeevalue());
             totalledAmount.setReadyOtherFeevalue(noTotalAmount.getOtherFeevalue());
             return totalledAmount;
             return totalledAmount;
         }
         }
-        return totalledAmount;
+
+        return  new InsPlyIncome();
     }
     }
 
 
     @Override
     @Override
@@ -426,7 +427,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             List<InsPlyIncome> list= this.baseMapper.queryNew(params);
             List<InsPlyIncome> list= this.baseMapper.queryNew(params);
             for (InsPlyIncome item : list) {
             for (InsPlyIncome item : list) {
                 item.setHandlingFeesStatus("1");
                 item.setHandlingFeesStatus("1");
-                item.setSettlementTime(LocalDateTime.now());
+                item.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(item);
                 baseMapper.updateById(item);
             }
             }
             SettlementDocumentaryLogEntity settlementDocumentaryLogEntity = new SettlementDocumentaryLogEntity();
             SettlementDocumentaryLogEntity settlementDocumentaryLogEntity = new SettlementDocumentaryLogEntity();
@@ -489,9 +490,6 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getNoPolicyno())){
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getNoPolicyno())){
             params.put("noPolicyno",insPlyIncomeVo.getNoPolicyno().split(","));
             params.put("noPolicyno",insPlyIncomeVo.getNoPolicyno().split(","));
         }
         }
-        if(insPlyIncomeVo.getSigndate()!=null){
-            params.put("signdate",insPlyIncomeVo.getSigndate());
-        }
         if(insPlyIncomeVo.getCreateTime()!=null){
         if(insPlyIncomeVo.getCreateTime()!=null){
             params.put("createTime",insPlyIncomeVo.getCreateTime());
             params.put("createTime",insPlyIncomeVo.getCreateTime());
         }
         }
@@ -513,6 +511,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getDay())){
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getDay())){
             params.put("day",insPlyIncomeVo.getDay());
             params.put("day",insPlyIncomeVo.getDay());
         }
         }
+        if(StringUtils.isNotEmpty(insPlyIncomeVo.getSignDateEnd())){
+            params.put("signDateEnd",insPlyIncomeVo.getSignDateEnd());
+        }
+        if(StringUtils.isNotEmpty(insPlyIncomeVo.getSignDateStart())){
+            params.put("signDateStart",insPlyIncomeVo.getSignDateStart());
+        }
         return params;
         return params;
     }
     }
 
 
@@ -569,21 +573,28 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     }
     }
 
 
     @Override
     @Override
-    public void importData(MultipartFile file, InsPlyIncomeVo insPlyIncomeVo) {
+    public void importData(MultipartFile MultipartFile) {
         List<InsPlyIncome> list = null;
         List<InsPlyIncome> list = null;
+        HashMap<String, Object> params = new HashMap<>();
         try {
         try {
-            List<InsPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(file, InsPlyIncomeExcelDto.class, 0, 1, 1);
+            List<InsPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(MultipartFile, InsPlyIncomeExcelDto.class, 0, 1, 1);
             for (InsPlyIncomeExcelDto excelItem : dtoList) {
             for (InsPlyIncomeExcelDto excelItem : dtoList) {
+                params.clear();
                 String licenseno = excelItem.getLicenseno();//车牌号
                 String licenseno = excelItem.getLicenseno();//车牌号
+                params.put("licenseno",licenseno);
                 String policyno = excelItem.getPolicyno(); //交强保单号
                 String policyno = excelItem.getPolicyno(); //交强保单号
+                params.put("policyno",policyno);
                 String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
                 String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
+                params.put("syPolicyno",syPolicyno);
                 String noPolicyno = excelItem.getNoPolicyno(); //非车保单号
                 String noPolicyno = excelItem.getNoPolicyno(); //非车保单号
-
+                params.put("noPolicyno",noPolicyno);
                 if(ObjectUtils.isNotEmpty(licenseno)){
                 if(ObjectUtils.isNotEmpty(licenseno)){
-                    InsPlyIncome insPlyIncome=baseMapper.findByLicenseno(licenseno,policyno,syPolicyno,noPolicyno);
-                    if(ObjectUtils.isNotEmpty(insPlyIncome)){
-                        insPlyIncome.setHandlingFeesStatus("1"); //已结算
-                        baseMapper.updateById(insPlyIncome);
+                    List<InsPlyIncome> insPlyIncome=baseMapper.findByLicenseno(params);
+                    for (InsPlyIncome item : insPlyIncome) {
+                        if(ObjectUtils.isNotEmpty(item)){
+                            item.setHandlingFeesStatus("1"); //已结算
+                            baseMapper.updateById(item);
+                        }
                     }
                     }
                 }
                 }
             }
             }
@@ -758,7 +769,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 String id = split[i];
                 String id = split[i];
                 InsPlyIncome insPlyIncome = baseMapper.selectById(id);
                 InsPlyIncome insPlyIncome = baseMapper.selectById(id);
                 insPlyIncome.setDocumentaryFeesStatus("1"); //1  为跟单费已经结算
                 insPlyIncome.setDocumentaryFeesStatus("1"); //1  为跟单费已经结算
-                insPlyIncome.setSettlementTime(LocalDateTime.now());
+                insPlyIncome.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(insPlyIncome);
                 baseMapper.updateById(insPlyIncome);
             }
             }
         }
         }
@@ -781,6 +792,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     public List<InsPlyIncome> totalBxAmount(InsPlyIncomeVo insPlyIncomeVo) {
     public List<InsPlyIncome> totalBxAmount(InsPlyIncomeVo insPlyIncomeVo) {
         HashMap<String, Object> params = new HashMap<>();
         HashMap<String, Object> params = new HashMap<>();
         params=this.saveParams(insPlyIncomeVo,params);
         params=this.saveParams(insPlyIncomeVo,params);
+        params.remove("handlingFeesStatus");
         List<InsPlyIncome>  resultList  =  baseMapper.totalBxAmount(params);
         List<InsPlyIncome>  resultList  =  baseMapper.totalBxAmount(params);
         return resultList;
         return resultList;
     }
     }
@@ -820,8 +832,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             String[] split = insPlyIncomeVo.getIds().split(",");
             String[] split = insPlyIncomeVo.getIds().split(",");
             for(String  id : split){
             for(String  id : split){
                 insPlyIncome.setId(id);
                 insPlyIncome.setId(id);
-                insPlyIncome.setHandlingFeesStatus("2");
-                insPlyIncome.setSettlementTime(LocalDateTime.now());
+                insPlyIncome.setHandlingFeesStatus("1");
+                insPlyIncome.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(insPlyIncome);
                 baseMapper.updateById(insPlyIncome);
             }
             }
 
 
@@ -865,7 +877,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 insPlyIncome.setContractId(insPlyIncomeVo.getContractId()); // 合同id
                 insPlyIncome.setContractId(insPlyIncomeVo.getContractId()); // 合同id
                 insPlyIncome.setContractFileId(insPlyIncomeVo.getContractFileId());
                 insPlyIncome.setContractFileId(insPlyIncomeVo.getContractFileId());
                 insPlyIncome.setVoucherNumber(insPlyIncomeVo.getVoucherNumber());
                 insPlyIncome.setVoucherNumber(insPlyIncomeVo.getVoucherNumber());
-                insPlyIncome.setSettlementTime(LocalDateTime.now());
+                insPlyIncome.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(insPlyIncome);
                 baseMapper.updateById(insPlyIncome);
             }
             }
         }
         }
@@ -967,5 +979,13 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         return HttpResult.ok("",uploadUrl + "excel/" + fileName);
         return HttpResult.ok("",uploadUrl + "excel/" + fileName);
     }
     }
 
 
+    @Override
+    public InsPlyIncome bxTotalAmount(InsPlyIncomeVo insPlyIncomeVo) {
+        HashMap<String, Object> params = new HashMap<>();
+        params = this.saveParams(insPlyIncomeVo, params);
+        InsPlyIncome totalledAmount =baseMapper.bxTotalAmount(params);  //总金额
+        return totalledAmount;
+    }
+
 
 
 }
 }

+ 2 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyMainServiceImpl.java

@@ -55,6 +55,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Date;
@@ -188,7 +189,7 @@ public class InsPlyMainServiceImpl extends ServiceImpl<InsPlyMainMapper, InsPlyM
         insPlyIncome.setAgreementId(excelVo.getAgreementId());
         insPlyIncome.setAgreementId(excelVo.getAgreementId());
         insPlyIncome.setLicenseno(excelVo.getLicenseno());
         insPlyIncome.setLicenseno(excelVo.getLicenseno());
         insPlyIncome.setPayDate(StringUtils.isNullOrEmpty(excelVo.getPayDate())?excelVo.getCreatetime():excelVo.getPayDate());
         insPlyIncome.setPayDate(StringUtils.isNullOrEmpty(excelVo.getPayDate())?excelVo.getCreatetime():excelVo.getPayDate());
-        insPlyIncome.setCreateTime(LocalDateTime.now() );
+        insPlyIncome.setCreateTime(LocalDate.now() );
         insPlyIncome.setPolicyno(excelVo.getPolicyno());
         insPlyIncome.setPolicyno(excelVo.getPolicyno());
         insPlyIncome.setRiskcode(excelVo.getRiskcode());
         insPlyIncome.setRiskcode(excelVo.getRiskcode());
         insPlyIncome.setTaxamount(excelVo.getTaxamount());
         insPlyIncome.setTaxamount(excelVo.getTaxamount());

+ 131 - 128
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -144,6 +144,10 @@
                     and pa.agreement_type =#{agreementType}
                     and pa.agreement_type =#{agreementType}
                 </if>
                 </if>
 
 
+                <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                    and a.signdate   between #{signDateStart} and #{signDateEnd}
+                </if>
+
                 <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
                 <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
                     and a.handling_fees_status =#{handlingFeesStatus}
                     and a.handling_fees_status =#{handlingFeesStatus}
                 </if>
                 </if>
@@ -331,17 +335,18 @@
         <include refid="income_com"/>
         <include refid="income_com"/>
         from  ins_ply_income a
         from  ins_ply_income a
         <where>
         <where>
+            1=1
             <if test="licenseno !=null  and  licenseno !=''">
             <if test="licenseno !=null  and  licenseno !=''">
-                a.licenseno=#{licenseno}
+                AND  a.licenseno=#{licenseno}
             </if>
             </if>
             <if test="policyno !=null  and  policyno !=''">
             <if test="policyno !=null  and  policyno !=''">
-                a.policyno=#{policyno}
+              AND  a.policyno=#{policyno}
             </if>
             </if>
             <if test="syPolicyno !=null  and  syPolicyno !=''">
             <if test="syPolicyno !=null  and  syPolicyno !=''">
-                a.sy_policyno=#{syPolicyno}
+                AND a.sy_policyno=#{syPolicyno}
             </if>
             </if>
             <if test="noPolicyno !=null  and  noPolicyno !=''">
             <if test="noPolicyno !=null  and  noPolicyno !=''">
-                a.no_policyno=#{noPolicyno}
+               AND a.no_policyno=#{noPolicyno}
             </if>
             </if>
         </where>
         </where>
     </select>
     </select>
@@ -361,7 +366,9 @@
                 <if test="agreementType !=null  and  agreementType  !=''">
                 <if test="agreementType !=null  and  agreementType  !=''">
                     and pa.agreement_type =#{agreementType}
                     and pa.agreement_type =#{agreementType}
                 </if>
                 </if>
-
+                <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                    and a.signdate   between #{signDateStart} and #{signDateEnd}
+                </if>
                 <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
                 <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
                     and a.handling_fees_status =#{handlingFeesStatus}
                     and a.handling_fees_status =#{handlingFeesStatus}
                 </if>
                 </if>
@@ -447,6 +454,113 @@
     </select>
     </select>
 
 
 
 
+    <select id="bxTotalAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
+            SELECT
+            SUM(a.commission_feevalue) AS commissionFeevalue,
+            SUM(CASE WHEN handling_fees_status = '0' THEN a.commission_feevalue ELSE 0 END) AS noInvoicCommissionFeevalue,
+            SUM(CASE WHEN handling_fees_status = '1' THEN a.commission_feevalue ELSE 0 END) AS readyCommissionFeevalue,
+            SUM(CASE WHEN handling_fees_status = '2' THEN a.commission_feevalue ELSE 0 END) AS invoicCommissionFeevalue
+            FROM
+            ins_ply_income a
+            LEFT JOIN
+            ptl_agreement pa ON pa.id = a.agreement_id
+            <where>
+                1=1
+                <if test="startDate !=null  and  startDate!='' and  endDate !=null and endDate !=''">
+                    and DATE_FORMAT( a.signdate, '%Y-%m-%d')  between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
+                </if>
+                <if test="agreementType !=null  and  agreementType  !=''">
+                    and pa.agreement_type =#{agreementType}
+                </if>
+                <if test="orderno !=null  and  orderno  !=''">
+                    and a.orderno =#{orderno}
+                </if>
+
+                <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                    and a.signdate   between #{signDateStart} and #{signDateEnd}
+                </if>
+                <if test="policyno !=null  and  policyno  !=''">
+                    and a.policyno =#{policyno}
+                </if>
+
+                <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                    and a.handling_fees_status =#{handlingFeesStatus}
+                </if>
+
+                <if test="documentaryFeesStatus !=null  and  documentaryFeesStatus  !=''">
+                    and a.documentary_fees_status =#{documentaryFeesStatus}
+                </if>
+
+                <if test="isNotCar !=null  and  isNotCar  !=''">
+                    and a.is_not_car =#{isNotCar}
+                </if>
+
+                <if test="isOther !=null  and  isOther  !=''">
+                    and a.is_not_documentary   =#{isOther}
+                </if>
+                <if test="licenseno != null and licenseno != ''  and licenseno.length > 0">
+                    and a.licenseno in
+                    <foreach collection="licenseno" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
+                <if test="policyno != null and policyno != ''  and policyno.length > 0">
+                    and a.policyno in
+                    <foreach collection="policyno" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
+                <if test="syPolicyno != null and syPolicyno != ''  and syPolicyno.length > 0">
+                    and a.sy_policyno in
+                    <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
+                <if test="noPolicyno != null and noPolicyno != ''  and noPolicyno.length > 0">
+                    and a.no_policyno in
+                    <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="signdate !=null  and  signdate  !=''">
+                    a.signdate =#{signdate}
+                </if>
+                <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                    a.partner_companies_id =#{partnerCompaniesId}
+                </if>
+
+                <if test="createTime !=null  and  createTime  !=''">
+                    a.create_time =#{createTime}
+                </if>
+                <if test="settlementTime !=null  and  settlementTime  !=''">
+                    a.settlement_time =#{settlementTime}
+                </if>
+
+                <if test="userId !=null  and  userId  !=''">
+                    and a.userId   =#{userId}
+                </if>
+                <if test="companyId !=null  and  companyId  !=''">
+                    and a.company_id   =#{companyId}
+                </if>
+                <if test="riskcode !=null  and  riskcode  !=''">
+                    and a.riskcode   =#{riskcode}
+                </if>
+                <if test="year !=null  and  year  !=''">
+                    AND YEAR(a.signdate) =#{year}
+                </if>
+                <if test="month !=null  and  month !=''">
+                    AND month(a.signdate) =#{month}
+                </if>
+                <if test="day !=null  and  day !=''">
+                    AND day(a.signdate) =#{day}
+                </if>
+            </where>
+    </select>
+
+
     <select id="totalPinAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
     <select id="totalPinAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
                 select
                 select
                 MAX( a.company_name ) AS "companyName",
                 MAX( a.company_name ) AS "companyName",
@@ -584,144 +698,32 @@
 
 
     <select id="totalBxAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
     <select id="totalBxAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
         select
         select
-        MAX( a.company_name ) AS "companyName",
-        sum( a.commission_feevalue ) AS "commissionFeevalue",
-        MAX( a.partner_companies_name) as "partnerCompaniesName",
-        SUM(b.readyCommissionFeevalue)  as "readyCommissionFeevalue",
-        SUM(c.invoicCommissionFeevalue) as "invoicCommissionFeevalue",
-        SUM(d.noInvoicCommissionFeevalue) as "noInvoicCommissionFeevalue",
-        MAX(b.ids) as "ids",
-        a.agreement_id AS "agreementId"
-        from  ins_ply_income a
-        LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
-        LEFT JOIN   (
-            select
-            MAX( a.company_name ) AS "companyName",
-            sum( a.commission_feevalue ) AS "readyCommissionFeevalue",
-            MAX( a.partner_companies_name) as "partnerCompaniesName",
-            GROUP_CONCAT(a.id) as  "ids",
-            a.agreement_id AS "agreementId"
-        from  ins_ply_income a
-        LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
-        <where>
-            1=1
-            AND   a.handling_fees_status = '1'
-            <if test="agreementType !=null  and agreementType!='' ">
-                AND pa.agreement_type =#{agreementType}
-            </if>
-            <if test="documentaryFeesStatus != null  and documentaryFeesStatus != '' ">
-                AND   a.documentary_fees_status = #{documentaryFeesStatus}
-            </if>
-            <if test="isOther !=null  and  isOther  !=''">
-                and a.is_not_documentary   =#{isOther}
-            </if>
-
-            <if test="isNotCar !=null  and  isNotCar  !=''">
-                and a.is_not_car =#{isNotCar}
-            </if>
-            <if test="year !=null  and  year  !=''">
-                AND YEAR(a.signdate) =#{year}
-            </if>
-            <if test="month !=null  and  month !=''">
-                AND month(a.signdate) =#{month}
-            </if>
-            <if test="day !=null  and  day !=''">
-                AND day(a.signdate) =#{day}
-            </if>
-        </where>
-        GROUP BY  a.agreement_id
-        )  b  on  a.agreement_id =b.agreementId
-        LEFT JOIN   (
-            select
-            MAX( a.company_name ) AS "companyName",
-            sum( a.commission_feevalue ) AS "invoicCommissionFeevalue",
-            MAX( a.partner_companies_name) as "partnerCompaniesName",
-            GROUP_CONCAT(a.id) as  "ids",
-            a.agreement_id AS "agreementId"
+        a.agreement_id AS "agreementId",
+        MAX(a.partner_companies_name) AS "partnerCompaniesName",
+        MAX(a.company_name) AS "companyName",
+        SUM(a.commission_feevalue) AS "commissionFeevalue",
+        SUM(CASE WHEN a.handling_fees_status = '2' THEN a.commission_feevalue ELSE 0 END) AS "invoicCommissionFeevalue",
+        SUM( CASE WHEN a.handling_fees_status = '0' THEN a.commission_feevalue ELSE 0 END ) AS "noInvoicCommissionFeevalue",
+        SUM(CASE WHEN a.handling_fees_status = '1' THEN a.commission_feevalue ELSE 0 END) AS "readyCommissionFeevalue",
+        GROUP_CONCAT(a.id) AS "ids"
         from  ins_ply_income a
         from  ins_ply_income a
         LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
         LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
         <where>
         <where>
             1=1
             1=1
-            AND   a.handling_fees_status = '2'
             <if test="agreementType !=null  and agreementType!='' ">
             <if test="agreementType !=null  and agreementType!='' ">
                 AND pa.agreement_type =#{agreementType}
                 AND pa.agreement_type =#{agreementType}
             </if>
             </if>
-            <if test="isOther !=null  and  isOther  !=''">
-                and a.is_not_documentary   =#{isOther}
-            </if>
-
-            <if test="documentaryFeesStatus != null  and documentaryFeesStatus != '' ">
-                AND   a.documentary_fees_status = #{documentaryFeesStatus}
-            </if>
-            <if test="isNotCar !=null  and  isNotCar  !=''">
-                and a.is_not_car =#{isNotCar}
-            </if>
-
             <if test="year !=null  and  year  !=''">
             <if test="year !=null  and  year  !=''">
                 AND YEAR(a.signdate) =#{year}
                 AND YEAR(a.signdate) =#{year}
             </if>
             </if>
-            <if test="month !=null  and  month !=''">
-                AND month(a.signdate) =#{month}
-            </if>
-            <if test="day !=null  and  day !=''">
-                AND day(a.signdate) =#{day}
-            </if>
-        </where>
-        GROUP BY  a.agreement_id
-        )  c  on  a.agreement_id =c.agreementId
-        LEFT JOIN   (
-        select
-        MAX( a.company_name ) AS "companyName",
-        sum( a.commission_feevalue ) AS "noInvoicCommissionFeevalue",
-        MAX( a.partner_companies_name) as "partnerCompaniesName",
-        GROUP_CONCAT(a.id) as  "ids",
-        a.agreement_id AS "agreementId"
-        from  ins_ply_income a
-        LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
-        <where>
-            1=1
-
-            AND   a.handling_fees_status = '0'
-            <if test="agreementType !=null  and agreementType!='' ">
-                AND pa.agreement_type =#{agreementType}
-            </if>
             <if test="isOther !=null  and  isOther  !=''">
             <if test="isOther !=null  and  isOther  !=''">
                 and a.is_not_documentary   =#{isOther}
                 and a.is_not_documentary   =#{isOther}
             </if>
             </if>
-
-            <if test="documentaryFeesStatus != null  and documentaryFeesStatus != '' ">
-                AND   a.documentary_fees_status = #{documentaryFeesStatus}
-            </if>
             <if test="isNotCar !=null  and  isNotCar  !=''">
             <if test="isNotCar !=null  and  isNotCar  !=''">
                 and a.is_not_car =#{isNotCar}
                 and a.is_not_car =#{isNotCar}
             </if>
             </if>
-
-            <if test="year !=null  and  year  !=''">
-                AND YEAR(a.signdate) =#{year}
-            </if>
-            <if test="month !=null  and  month !=''">
-                AND month(a.signdate) =#{month}
-            </if>
-            <if test="day !=null  and  day !=''">
-                AND day(a.signdate) =#{day}
-            </if>
-        </where>
-        GROUP BY  a.agreement_id
-        )  d  on  a.agreement_id =d.agreementId
-        <where>
-            1=1
-
-            <if test="agreementType !=null  and agreementType!='' ">
-                AND pa.agreement_type =#{agreementType}
-            </if>
-            <if test="year !=null  and  year  !=''">
-                AND YEAR(a.signdate) =#{year}
-            </if>
-            <if test="isOther !=null  and  isOther  !=''">
-                and a.is_not_documentary   =#{isOther}
-            </if>
-            <if test="isNotCar !=null  and  isNotCar  !=''">
-                and a.is_not_car =#{isNotCar}
+            <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                and a.handling_fees_status =#{handlingFeesStatus}
             </if>
             </if>
             <if test="month !=null  and  month !=''">
             <if test="month !=null  and  month !=''">
                 AND month(a.signdate) =#{month}
                 AND month(a.signdate) =#{month}
@@ -732,12 +734,13 @@
         </where>
         </where>
         GROUP BY  a.agreement_id
         GROUP BY  a.agreement_id
     </select>
     </select>
+
     <select id="allOtherAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
     <select id="allOtherAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
         SELECT
         SELECT
             a.company_id AS "companyId",
             a.company_id AS "companyId",
             MAX( a.company_name ) AS "companyName",
             MAX( a.company_name ) AS "companyName",
             MAX( a.partner_companies_name) as "partnerCompaniesName",
             MAX( a.partner_companies_name) as "partnerCompaniesName",
-            IF(SUM( c.unsettledAmount ) IS NULL , sum( a.other_feevalue ),  SUM( c.unsettledAmount )  ) AS "noInvoicCommissionFeevalue",
+            IF(MAX( c.unsettledAmount ) IS NULL , sum( a.other_feevalue ),  sum( a.other_feevalue ) - MAX(d.settleMentAmount) ) AS "noInvoicCommissionFeevalue",
             GROUP_CONCAT(a.id) as  "incomeIds",
             GROUP_CONCAT(a.id) as  "incomeIds",
             MAX(d.settleMentAmount) as "invoicCommissionFeevalue",
             MAX(d.settleMentAmount) as "invoicCommissionFeevalue",
             MAX(e.settleMentAmount) as "settleMentAmount",
             MAX(e.settleMentAmount) as "settleMentAmount",