Browse Source

Merge remote-tracking branch 'origin/test' into test

wks 2 năm trước cách đây
mục cha
commit
1fd62a06e1
31 tập tin đã thay đổi với 381 bổ sung243 xóa
  1. 3 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java
  2. 11 0
      src/main/java/com/ydtech/modules/esm/controller/EsmRetailController.java
  3. 2 0
      src/main/java/com/ydtech/modules/esm/dao/EsmRetailDao.java
  4. 7 0
      src/main/java/com/ydtech/modules/esm/dao/impl/EsmRetailDaoImpl.java
  5. 8 2
      src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java
  6. 5 1
      src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java
  7. 1 0
      src/main/java/com/ydtech/modules/fnc/entity/InsAreaCompany.java
  8. 7 7
      src/main/java/com/ydtech/modules/fnc/entity/InsPlyIncome.java
  9. 4 0
      src/main/java/com/ydtech/modules/fnc/entity/SettlementDocumentaryFeesEntity.java
  10. 3 1
      src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java
  11. 2 1
      src/main/java/com/ydtech/modules/fnc/service/impl/InsFeeAuditServiceImpl.java
  12. 42 22
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  13. 2 1
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyMainServiceImpl.java
  14. 58 3
      src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java
  15. 2 2
      src/main/java/com/ydtech/modules/inv/controller/InvReceivableController.java
  16. 9 7
      src/main/java/com/ydtech/modules/inv/controller/invAccountExcelController.java
  17. 2 2
      src/main/java/com/ydtech/modules/inv/dao/InvAccountExcelMapper.java
  18. 3 3
      src/main/java/com/ydtech/modules/inv/model/InvAccountOperate.java
  19. 3 3
      src/main/java/com/ydtech/modules/inv/model/excel/InvDisburseExcel.java
  20. 12 14
      src/main/java/com/ydtech/modules/inv/model/vo/InvAccountOperateVo.java
  21. 2 2
      src/main/java/com/ydtech/modules/inv/service/InvAccountExcelService.java
  22. 4 11
      src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExcelServiceImpl.java
  23. 4 0
      src/main/java/com/ydtech/modules/order/entity/InsOrders.java
  24. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  25. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java
  26. 9 7
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java
  27. 1 1
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java
  28. 131 128
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  29. 33 20
      src/main/resources/mapper/modules/inv/InvAccountExcelMapper.xml
  30. 4 1
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  31. 5 2
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml

+ 3 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java

@@ -397,6 +397,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         {
             String area = deptId.substring(2,8);
             SysArea sysArea = sysAreaMapper.selectOne(new LambdaQueryWrapper<SysArea>().eq(SysArea::getAreaCode, area));
+            if(sysArea == null){
+                return "";
+            }
             List<SysArea> sysAreas = sysAreaService.queryAllParent(sysArea);
             result.append(sysAreas.get(2).getAreaCname());
             result.append(sysAreas.get(1).getAreaCname());

+ 11 - 0
src/main/java/com/ydtech/modules/esm/controller/EsmRetailController.java

@@ -23,6 +23,17 @@ public class EsmRetailController extends BaseController {
     @Autowired
     EsmRetailService esmRetailService;
 
+    /**
+     * 删除信息
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/deleteRetail")
+    public HttpResult delete(String id){
+        Integer insert = esmRetailService.delete(id);
+        return insert > 0 ? HttpResult.ok("删除成功", insert) : HttpResult.error("删除失败");
+    }
 
     /**
      * 保存信息

+ 2 - 0
src/main/java/com/ydtech/modules/esm/dao/EsmRetailDao.java

@@ -25,6 +25,8 @@ public interface EsmRetailDao {
 
     public Integer update(EsmRetail model);
 
+    public Integer delete(String id);
+
 //    public Integer updateSelective(EsmRetail model);
 }
 

+ 7 - 0
src/main/java/com/ydtech/modules/esm/dao/impl/EsmRetailDaoImpl.java

@@ -131,6 +131,13 @@ public class EsmRetailDaoImpl implements EsmRetailDao {
         return jdbcTemplate.update(sql, params);
     }
 
+    @Override
+    public Integer delete(String id){
+        String sql = "delete from esm_retail where id=?";
+        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
+        return jdbcTemplate.update(sql, new Object[]{id});
+    }
+
 
 }
 

+ 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);
         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")
     @ApiModelProperty(value = "结算手续费")
     public HttpResult<Object> balance(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
@@ -140,9 +146,9 @@ public class InsPlyIncomeController extends BaseController {
     @ApiImplicitParams({
             @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("导入成功");
     }

+ 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);
 
 
-    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 java.io.Serializable;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import io.swagger.annotations.ApiModel;
 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("记录插入时间")
     @TableField("create_time")
-    private LocalDateTime createTime;
+    private LocalDate createTime;
 
     @ApiModelProperty("开票时间")
     @TableField("invoic_time")
@@ -136,11 +136,11 @@ public class InsPlyIncome implements Serializable {
 
     @ApiModelProperty("结算日期")
     @TableField("settlement_time")
-    private LocalDateTime settlementTime;
+    private LocalDate settlementTime;
 
     @ApiModelProperty("修改日期")
     @TableField("update_time")
-    private LocalDateTime updateTime;
+    private LocalDate updateTime;
 
     @ApiModelProperty("结算人")
     @TableField("settlement_user_id")
@@ -329,7 +329,7 @@ public class InsPlyIncome implements Serializable {
 
     @ApiModelProperty("跟单费结算金额")
     @TableField(exist = false)
-    private BigDecimal settlementAmount;
+    private BigDecimal settleMentAmount;
 
     @ApiModelProperty("跟单费未结算金额")
     @TableField(exist = false)
@@ -353,7 +353,7 @@ public class InsPlyIncome implements Serializable {
     private String monthSigdate;
 
 
-    @ApiModelProperty("结算手续费")
+    @ApiModelProperty("已开票已结算手续费")
     @TableField(exist = false)
     private BigDecimal readyCommissionFeevalue;
     @ApiModelProperty("未结算跟单费")
@@ -374,7 +374,7 @@ public class InsPlyIncome implements Serializable {
     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.policyno = policyno;
         this.syPolicyno = syPolicyno;
@@ -408,6 +408,6 @@ public class InsPlyIncome implements Serializable {
         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")
     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);
 
 
-    void importData(MultipartFile file, InsPlyIncomeVo insPlyIncomeVo);
+    void importData(MultipartFile MultipartFile);
 
     void updateByEntity(InsPlyIncomeVo insPlyIncomeVo);
 
@@ -79,4 +79,6 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult bxHandlingexcel(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 java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Date;
@@ -691,7 +692,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setPayDate(StringUtils.isNullOrEmpty(plyDto.getPayDate())?plyDto.getCreatetime():plyDto.getPayDate());
         insPlyIncome.setSignDate(StringUtils.isNullOrEmpty(plyDto.getInsidePayTime())?plyDto.getPayDate():plyDto.getInsidePayTime());
-        insPlyIncome.setCreateTime(LocalDateTime.now() );
+        insPlyIncome.setCreateTime(LocalDate.now() );
         if(StringUtils.isNotEmpty(plyDto.getJqpolicyno())){
             insPlyIncome.setPolicyno(plyDto.getJqpolicyno());
             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.setLicenseno(order.getLicenseno());
         insPlyIncome.setTaxamount(insAreaCompany.getTaxamount());
-        insPlyIncome.setCreateTime(LocalDateTime.now());
+        insPlyIncome.setCreateTime(LocalDate.now());
         insPlyIncome.setDocumentaryFeesStatus("0");
         insPlyIncome.setHandlingFeesStatus("0");
         insPlyIncome.setNoNoTaxPremium(insPlyIncome.getNoNoTaxPremium());
@@ -203,7 +203,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setAgreementId(insFeeOrderNew.getAgreementId());
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setTaxamount(insAreaCompany.getTaxamount());
-        insPlyIncome.setCreateTime(LocalDateTime.now());
+        insPlyIncome.setCreateTime(LocalDate.now());
         insPlyIncome.setDocumentaryFeesStatus("0");
         insPlyIncome.setHandlingFeesStatus("0");
         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(),
-                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.setJqPremium(insFeeOrderNew.getJqPremium());
@@ -248,7 +248,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         BigDecimal handlingProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(), insFeeOrderNew.getSySuperviseCostsProportion(),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()
-        ,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);
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
         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(),
                 noPolicyno,null,insFeeOrderNew.getDeptId(), null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),
                 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.setSyReceivableProportion(syReceivableProportion);
         insPlyIncome.setNoReceivableProportion(noReceivableProportion);
@@ -411,11 +411,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         InsPlyIncome noTotalAmount =baseMapper.totalAmount(params);
         if(ObjectUtils.isNotEmpty(totalledAmount) && ObjectUtils.isNotEmpty(noTotalAmount)){
             totalledAmount.setReadyTotalFeevalue(noTotalAmount.getTotalFeevalue());
-            totalledAmount.setReadyCommissionFeevalue(noTotalAmount.getReadyCommissionFeevalue());
+            totalledAmount.setReadyCommissionFeevalue(noTotalAmount.getCommissionFeevalue());
             totalledAmount.setReadyOtherFeevalue(noTotalAmount.getOtherFeevalue());
             return totalledAmount;
         }
-        return totalledAmount;
+
+        return  new InsPlyIncome();
     }
 
     @Override
@@ -426,7 +427,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             List<InsPlyIncome> list= this.baseMapper.queryNew(params);
             for (InsPlyIncome item : list) {
                 item.setHandlingFeesStatus("1");
-                item.setSettlementTime(LocalDateTime.now());
+                item.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(item);
             }
             SettlementDocumentaryLogEntity settlementDocumentaryLogEntity = new SettlementDocumentaryLogEntity();
@@ -489,9 +490,6 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getNoPolicyno())){
             params.put("noPolicyno",insPlyIncomeVo.getNoPolicyno().split(","));
         }
-        if(insPlyIncomeVo.getSigndate()!=null){
-            params.put("signdate",insPlyIncomeVo.getSigndate());
-        }
         if(insPlyIncomeVo.getCreateTime()!=null){
             params.put("createTime",insPlyIncomeVo.getCreateTime());
         }
@@ -513,6 +511,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         if(StringUtils.isNotEmpty(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;
     }
 
@@ -569,21 +573,28 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     }
 
     @Override
-    public void importData(MultipartFile file, InsPlyIncomeVo insPlyIncomeVo) {
+    public void importData(MultipartFile MultipartFile) {
         List<InsPlyIncome> list = null;
+        HashMap<String, Object> params = new HashMap<>();
         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) {
+                params.clear();
                 String licenseno = excelItem.getLicenseno();//车牌号
+                params.put("licenseno",licenseno);
                 String policyno = excelItem.getPolicyno(); //交强保单号
+                params.put("policyno",policyno);
                 String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
+                params.put("syPolicyno",syPolicyno);
                 String noPolicyno = excelItem.getNoPolicyno(); //非车保单号
-
+                params.put("noPolicyno",noPolicyno);
                 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];
                 InsPlyIncome insPlyIncome = baseMapper.selectById(id);
                 insPlyIncome.setDocumentaryFeesStatus("1"); //1  为跟单费已经结算
-                insPlyIncome.setSettlementTime(LocalDateTime.now());
+                insPlyIncome.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(insPlyIncome);
             }
         }
@@ -781,6 +792,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     public List<InsPlyIncome> totalBxAmount(InsPlyIncomeVo insPlyIncomeVo) {
         HashMap<String, Object> params = new HashMap<>();
         params=this.saveParams(insPlyIncomeVo,params);
+        params.remove("handlingFeesStatus");
         List<InsPlyIncome>  resultList  =  baseMapper.totalBxAmount(params);
         return resultList;
     }
@@ -820,8 +832,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             String[] split = insPlyIncomeVo.getIds().split(",");
             for(String  id : split){
                 insPlyIncome.setId(id);
-                insPlyIncome.setHandlingFeesStatus("2");
-                insPlyIncome.setSettlementTime(LocalDateTime.now());
+                insPlyIncome.setHandlingFeesStatus("1");
+                insPlyIncome.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(insPlyIncome);
             }
 
@@ -865,7 +877,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 insPlyIncome.setContractId(insPlyIncomeVo.getContractId()); // 合同id
                 insPlyIncome.setContractFileId(insPlyIncomeVo.getContractFileId());
                 insPlyIncome.setVoucherNumber(insPlyIncomeVo.getVoucherNumber());
-                insPlyIncome.setSettlementTime(LocalDateTime.now());
+                insPlyIncome.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(insPlyIncome);
             }
         }
@@ -967,5 +979,13 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         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 java.io.IOException;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Date;
@@ -188,7 +189,7 @@ public class InsPlyMainServiceImpl extends ServiceImpl<InsPlyMainMapper, InsPlyM
         insPlyIncome.setAgreementId(excelVo.getAgreementId());
         insPlyIncome.setLicenseno(excelVo.getLicenseno());
         insPlyIncome.setPayDate(StringUtils.isNullOrEmpty(excelVo.getPayDate())?excelVo.getCreatetime():excelVo.getPayDate());
-        insPlyIncome.setCreateTime(LocalDateTime.now() );
+        insPlyIncome.setCreateTime(LocalDate.now() );
         insPlyIncome.setPolicyno(excelVo.getPolicyno());
         insPlyIncome.setRiskcode(excelVo.getRiskcode());
         insPlyIncome.setTaxamount(excelVo.getTaxamount());

+ 58 - 3
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java

@@ -49,9 +49,9 @@ public class InsPlyIncomeVo implements Serializable {
     private LocalDate endDate;
 
 
-    @ApiModelProperty(value = "签单日期")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private LocalDate signdate;
+//    @ApiModelProperty(value = "签单日期")
+//    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+//    private LocalDate signdate;
 
     @ApiModelProperty(value = "创建日期")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@@ -183,4 +183,59 @@ public class InsPlyIncomeVo implements Serializable {
 
     @ApiModelProperty("开票ids")
     private String incomeIds;
+
+    @ApiModelProperty("手续费比例")
+    private BigDecimal commissionFeerate;
+
+    @ApiModelProperty("交强手续费比例")
+    private BigDecimal jqSuperviseCostsProportion;
+
+    @ApiModelProperty("商业手续费比例")
+    private BigDecimal sySuperviseCostsProportion;
+
+    @ApiModelProperty("应收金额")
+    private BigDecimal receivableAmount;
+
+    @ApiModelProperty("应收金额")
+    private BigDecimal allFeeValue;
+
+    @ApiModelProperty(value = "签单结束日期")
+    private String signDateEnd;
+    @ApiModelProperty(value = "签单开始日期")
+    private String signDateStart;
+
+    @ApiModelProperty("交强险含税保费")
+    private BigDecimal jqPremium;
+
+
+
+    @ApiModelProperty("商业险含保费")
+    private BigDecimal syPremium;
+
+
+    @ApiModelProperty("非车险含保费")
+    private BigDecimal noPremium;
+
+    @ApiModelProperty("交强险不含税保费")
+    private BigDecimal jqNoTaxPremium;
+
+    @ApiModelProperty("商业险不含税保费")
+    private BigDecimal syNoTaxPremium;
+
+
+    @ApiModelProperty("非车险不含税保费")
+    private BigDecimal noNoTaxPremium;
+
+    @ApiModelProperty("交强跟单比例")
+    private BigDecimal jqOtherCostsProportion;
+
+    @ApiModelProperty("商业跟单比例")
+    private BigDecimal syOtherCostsProportion;
+
+    @ApiModelProperty("交强跟单金额")
+    private BigDecimal jqOtherCostsPremium;
+
+    @ApiModelProperty("商业跟单金额")
+    private BigDecimal syOtherCostsPremium;
+
 }

+ 2 - 2
src/main/java/com/ydtech/modules/inv/controller/InvReceivableController.java

@@ -241,11 +241,11 @@ public class InvReceivableController extends BaseController {
 
     @GetMapping("getAccountsReceivable")
     public HttpResult getAccountsReceivable(){
-        return HttpResult.ok("下载成功","template/finance/accountsReceivable.xlsx");
+        return HttpResult.ok("下载成功","/template/finance/accountsReceivable.xlsx");
     }
 
     @GetMapping("/getSettlement")
     public HttpResult getSettlement(){
-       return HttpResult.ok("下载成功","template/finance/settlement.xlsx");
+       return HttpResult.ok("下载成功","/template/finance/settlement.xlsx");
     }
 }

+ 9 - 7
src/main/java/com/ydtech/modules/inv/controller/invAccountExcelController.java

@@ -3,15 +3,14 @@ package com.ydtech.modules.inv.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.ydtech.constants.enums.inv.InvPayMethodEnum;
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.core.page.PageResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.inv.dao.InvAccountExcelMapper;
+import com.ydtech.modules.inv.dao.InvAccountOperateMapper;
 import com.ydtech.modules.inv.model.InvAccountExcel;
+import com.ydtech.modules.inv.model.InvAccountOperate;
 import com.ydtech.modules.inv.model.excel.InvDisburseExcel;
-import com.ydtech.modules.inv.model.po.InvSettlementSource;
-import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
-import com.ydtech.modules.inv.model.vo.InvSettlementSourceQueryVo;
+import com.ydtech.modules.inv.model.vo.InvAccountOperateVo;
 import com.ydtech.modules.inv.service.InvAccountExcelService;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
 import io.swagger.annotations.Api;
@@ -44,6 +43,9 @@ public class invAccountExcelController {
     @Resource
     private InvAccountExcelMapper invAccountExcelMapper;
 
+    @Resource
+    private InvAccountOperateMapper invAccountOperateMapper;
+
     @Value("${upload.file.path}")
     private String uploadPath;
 
@@ -59,7 +61,7 @@ public class invAccountExcelController {
     @PostMapping("deriveReport")
     @ApiOperation("导出支出报表")
     public HttpResult deriveReport(@RequestBody List<String> idList) throws IOException {
-        List<InvAccountExcel> insAccountExcels = invAccountExcelMapper.selectBatchIds(idList);
+        List<InvAccountOperate> insAccountExcels = invAccountOperateMapper.selectBatchIds(idList);
         String uploadPath = this.uploadPath + "/excel/";
         Path path = Paths.get(uploadPath);
         if (!Files.exists(path)) {
@@ -151,8 +153,8 @@ public class invAccountExcelController {
 
     @ApiOperation("支出报表查看")
     @PostMapping("getDisburse")
-    public HttpResult getDisburse(@RequestBody InvAccountExcelVo invAccountExcelVo) {
-        return invAccountExcelService.selectDisburse(invAccountExcelVo);
+    public HttpResult getDisburse(@RequestBody InvAccountOperateVo invAccountOperateVo) {
+        return invAccountExcelService.selectDisburse(invAccountOperateVo);
     }
 
 

+ 2 - 2
src/main/java/com/ydtech/modules/inv/dao/InvAccountExcelMapper.java

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.inv.model.InvAccountExcel;
-import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
+import com.ydtech.modules.inv.model.vo.InvAccountOperateVo;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -17,7 +17,7 @@ import org.apache.ibatis.annotations.Param;
 public interface InvAccountExcelMapper extends BaseMapper<InvAccountExcel> {
     IPage<InvAccountExcel> selectExcelAccount(Page page, @Param("insAccountExcel") InvAccountExcel insAccountExcel);
 
-    IPage<InvAccountExcelVo> selectDisburse(Page page, @Param("insAccountExcel") InvAccountExcelVo insAccountExcelVo);
+    IPage<InvAccountOperateVo> selectDisburse(Page page, @Param("inAccountOperateVo") InvAccountOperateVo invAccountOperateVo);
 }
 
 

+ 3 - 3
src/main/java/com/ydtech/modules/inv/model/InvAccountOperate.java

@@ -60,7 +60,7 @@ public class InvAccountOperate implements Serializable {
 
 
     @ApiModelProperty("无需传递")
-    @ExcelProperty("板块")
+//    @ExcelProperty("板块")
     @TableField(exist = false)
     private String plate;
 
@@ -81,7 +81,7 @@ public class InvAccountOperate implements Serializable {
      * 资金流向
      */
     @ApiModelProperty(value = "资金流向")
-    @ExcelProperty("资金流向")
+//    @ExcelProperty("资金流向")
     private String fundFlow;
 
     /**
@@ -102,7 +102,7 @@ public class InvAccountOperate implements Serializable {
     private String fundUse;
 
     @ApiModelProperty("资金用途分项")
-    @ExcelProperty("分项")
+//    @ExcelProperty("分项")
     private String fundFen;
 
     /**

+ 3 - 3
src/main/java/com/ydtech/modules/inv/model/excel/InvDisburseExcel.java

@@ -10,10 +10,10 @@ import java.util.Date;
 
 @Data
 public class InvDisburseExcel implements Serializable {
-    @ExcelProperty("日期")
-    @ApiModelProperty(value = "申请时间")
+    @ExcelProperty("转账日期")
+    @ApiModelProperty(value = "转账日期")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date applyTime;
+    private String createTime;
 
     @ExcelProperty("费用类型")
     @ApiModelProperty(value = "资金用途")

+ 12 - 14
src/main/java/com/ydtech/modules/inv/model/vo/InvAccountExcelVo.java → src/main/java/com/ydtech/modules/inv/model/vo/InvAccountOperateVo.java

@@ -6,21 +6,18 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
 import java.util.Date;
 
 @Data
-public class InvAccountExcelVo implements Serializable {
+public class InvAccountOperateVo implements Serializable {
+    @ApiModelProperty(value = "转账记录id")
+    private String accountOperateId;
 
-    @ApiModelProperty(value = "资金申请表id")
-    private String excelAccountOperateId;
-
-    @ExcelProperty("日期")
-    @ApiModelProperty(value = "申请时间")
+    @ExcelProperty("转账日期")
+    @ApiModelProperty(value = "转账时间")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    @NotBlank
-    private Date applyTime;
+    private Date createTime;
 
     @ExcelProperty("费用类型")
     @ApiModelProperty(value = "资金用途")
@@ -49,18 +46,19 @@ public class InvAccountExcelVo implements Serializable {
     @ApiModelProperty(value = "收款单位信息")
     private String collectionMessage;
 
+    /**
+     * 转账时间开始
+     */
     @ApiModelProperty(value = "申请时间起")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @TableField(exist = false)
-    private Date applyTimeStart;
+    private String createTimeStart;
 
     /**
-     * 申请时间止
+     * 转账时间结束
      */
     @ApiModelProperty(value = "申请时间止")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @TableField(exist = false)
-    private Date applyTimeEnd;
+    private String createTimeEnd;
 
     private int pageNum;
 

+ 2 - 2
src/main/java/com/ydtech/modules/inv/service/InvAccountExcelService.java

@@ -4,7 +4,7 @@ package com.ydtech.modules.inv.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.inv.model.InvAccountExcel;
-import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
+import com.ydtech.modules.inv.model.vo.InvAccountOperateVo;
 
 import java.util.List;
 
@@ -18,7 +18,7 @@ public interface InvAccountExcelService extends IService<InvAccountExcel> {
 
     HttpResult selectAccountExcel(InvAccountExcel invAccountExcel);
 
-    HttpResult selectDisburse(InvAccountExcelVo InvAccountExcelVo);
+    HttpResult selectDisburse(InvAccountOperateVo invAccountOperateVo);
 
     HttpResult updateTransferFlag(String excelAccountOperateId);
 

+ 4 - 11
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExcelServiceImpl.java

@@ -1,7 +1,6 @@
 package com.ydtech.modules.inv.service.impl;
 
 
-import com.alibaba.excel.util.WorkBookUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -10,16 +9,11 @@ import com.ydtech.constants.enums.inv.InvPayMethodEnum;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.inv.dao.InvAccountExcelMapper;
 import com.ydtech.modules.inv.model.*;
-import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
+import com.ydtech.modules.inv.model.vo.InvAccountOperateVo;
 import com.ydtech.modules.inv.service.*;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -107,10 +101,9 @@ public class InvAccountExcelServiceImpl extends ServiceImpl<InvAccountExcelMappe
     }
 
     //支出报表查看
-    @Override
-    public HttpResult selectDisburse(InvAccountExcelVo invAccountExcelVo){
-        Page<InvAccountExcelVo> page = new Page<>(invAccountExcelVo.getPageNum(), invAccountExcelVo.getPageSize());
-        IPage<InvAccountExcelVo> invAccountExcelIPage = insAccountExcelMapper.selectDisburse(page, invAccountExcelVo);
+    public HttpResult selectDisburse(InvAccountOperateVo invAccountOperateVo){
+        Page<InvAccountOperateVo> page = new Page<>(invAccountOperateVo.getPageNum(), invAccountOperateVo.getPageSize());
+        IPage<InvAccountOperateVo> invAccountExcelIPage = insAccountExcelMapper.selectDisburse(page, invAccountOperateVo);
         return HttpResult.ok("", invAccountExcelIPage);
     }
 

+ 4 - 0
src/main/java/com/ydtech/modules/order/entity/InsOrders.java

@@ -239,6 +239,10 @@ public class InsOrders implements Serializable {
     private String agreementCode;   //协议code
     @TableField(exist = false)
     private String agreementName;   //协议名称
+
+    @TableField(exist = false)
+    private String partnerCompaniesName;   //合作公司简称
+
     public InsOrders(SysUser user, SysDept dept, BaseQuoteInfoVo quoteInfoVo) {
         // 2. 组装订单
         this.setQuoteno(String.valueOf(quoteInfoVo.getQuoteno()));

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

@@ -769,7 +769,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
         List<InsFeeOrderNew> insFeeOrderNews = new ArrayList<>();
         if(!companyIds.isEmpty()) {
-            insFeeOrderNewService.getInsFeeOrderNewListByCompanyId(companyIds);
+            insFeeOrderNews = insFeeOrderNewService.getInsFeeOrderNewListByCompanyId(companyIds);
         }
 
         //计算费用

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

@@ -593,7 +593,7 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
             insAreaCompanyAccidentalDriving.setRideRiskName(insAreaCompanyAccidentalDriving.getRideRiskName());
             insAreaCompanyAccidentalDrivings.add(insAreaCompanyAccidentalDriving);
         });
-        insAreaCompany.setIsDjq(calculatePremiumResponse.getBasePart().getIsDjq());
+        insAreaCompany.setIsDjq(calculatePremiumResponse.getBasePart().getIsDjq().equals("")?"0":calculatePremiumResponse.getBasePart().getIsDjq());
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany,insAreaCompanyAccidentalDrivings);
         quoteRespVo.setCompanyId(orderNo);
         //添加调用费用匹配功能

+ 9 - 7
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -580,13 +580,15 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         EsmInsCompany esmInsCompany;
 
         // 获取保险公司
-        if (AgreementType.AT2.getCode().equals(agreementSaveDto.getAgreementType())) {
-            String message = String.format("协议为 %s 保险公司必须传入", AgreementType.AT2.getDesc());
-            AssertionUtils.isStringEmpty(agreementSaveDto.getAssociationCompaniesId(), message);
-            esmInsCompany = esmInsCompanyService.isExists(agreementSaveDto.getAssociationCompaniesId());
-        } else {
-            esmInsCompany = esmInsCompanyService.getBySubsidiary(agreementSaveDto.getPartnerCompaniesId());
-        }
+//        if (AgreementType.AT2.getCode().equals(agreementSaveDto.getAgreementType())) {
+//            String message = String.format("协议为 %s 保险公司必须传入", AgreementType.AT2.getDesc());
+//            AssertionUtils.isStringEmpty(agreementSaveDto.getAssociationCompaniesId(), message);
+//            esmInsCompany = esmInsCompanyService.isExists(agreementSaveDto.getAssociationCompaniesId());
+//        } else {
+//            esmInsCompany = esmInsCompanyService.getBySubsidiary(agreementSaveDto.getPartnerCompaniesId());
+//        }
+
+        esmInsCompany = esmInsCompanyService.getBySubsidiary(agreementSaveDto.getPartnerCompaniesId());
 
         // 验证用户名密码 python api 对接需要验证用户名
         if (!ObjectUtils.isEmpty(attribution.getApiType()) && PtlApiType.PTL_API_2.getCode() == attribution.getApiType()) {

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

@@ -1208,7 +1208,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 //        ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getAgreementId, agreementProductQueryVo.getAgreementId());
         //保险公司id
         if(agreementProductQueryVo.getCompanyId() != null){
-            LambdaQueryWrapper<PtlAgreement> eq = new LambdaQueryWrapper<PtlAgreement>().eq(PtlAgreement::getPartnerCompaniesId, agreementProductQueryVo.getCompanyId());
+            LambdaQueryWrapper<PtlAgreement> eq = new LambdaQueryWrapper<PtlAgreement>().eq(PtlAgreement::getInsuranceCompanyId, agreementProductQueryVo.getCompanyId());
             List<PtlAgreement> list = ptlAgreementService.list(eq);
             List<String> agreementIds = list.stream().map(PtlAgreement::getId).collect(Collectors.toList());
             ptlAgreementProductCostsNewLambdaQueryWrapper.in(PtlAgreementProductCostsNew::getAgreementId, agreementIds);

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

@@ -144,6 +144,10 @@
                     and pa.agreement_type =#{agreementType}
                 </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  !=''">
                     and a.handling_fees_status =#{handlingFeesStatus}
                 </if>
@@ -331,17 +335,18 @@
         <include refid="income_com"/>
         from  ins_ply_income a
         <where>
+            1=1
             <if test="licenseno !=null  and  licenseno !=''">
-                a.licenseno=#{licenseno}
+                AND  a.licenseno=#{licenseno}
             </if>
             <if test="policyno !=null  and  policyno !=''">
-                a.policyno=#{policyno}
+              AND  a.policyno=#{policyno}
             </if>
             <if test="syPolicyno !=null  and  syPolicyno !=''">
-                a.sy_policyno=#{syPolicyno}
+                AND a.sy_policyno=#{syPolicyno}
             </if>
             <if test="noPolicyno !=null  and  noPolicyno !=''">
-                a.no_policyno=#{noPolicyno}
+               AND a.no_policyno=#{noPolicyno}
             </if>
         </where>
     </select>
@@ -361,7 +366,9 @@
                 <if test="agreementType !=null  and  agreementType  !=''">
                     and pa.agreement_type =#{agreementType}
                 </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  !=''">
                     and a.handling_fees_status =#{handlingFeesStatus}
                 </if>
@@ -447,6 +454,113 @@
     </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
                 MAX( a.company_name ) AS "companyName",
@@ -584,144 +698,32 @@
 
     <select id="totalBxAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
         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
         LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
         <where>
             1=1
-            AND   a.handling_fees_status = '2'
             <if test="agreementType !=null  and agreementType!='' ">
                 AND pa.agreement_type =#{agreementType}
             </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  !=''">
                 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
-        )  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  !=''">
                 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  !=''">
-                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 test="month !=null  and  month !=''">
                 AND month(a.signdate) =#{month}
@@ -732,12 +734,13 @@
         </where>
         GROUP BY  a.agreement_id
     </select>
+
     <select id="allOtherAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
         SELECT
             a.company_id AS "companyId",
             MAX( a.company_name ) AS "companyName",
             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",
             MAX(d.settleMentAmount) as "invoicCommissionFeevalue",
             MAX(e.settleMentAmount) as "settleMentAmount",

+ 33 - 20
src/main/resources/mapper/modules/inv/InvAccountExcelMapper.xml

@@ -120,44 +120,57 @@
         desc
     </select>
 
+    <resultMap id="InvAccountOperateVoResultMap" type="com.ydtech.modules.inv.model.vo.InvAccountOperateVo">
+        <id property="accountOperateId" column="account_operate_id" jdbcType="VARCHAR"/>
+        <result property="company" column="company" jdbcType="VARCHAR"/>
+        <result property="applySector" column="apply_sector" jdbcType="VARCHAR"/>
+        <result property="collectionMessage" column="collection_message" jdbcType="VARCHAR"/>
+        <result property="fundUse" column="fund_use" jdbcType="VARCHAR"/>
+        <result property="applyAmount" column="apply_amount" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="remark" column="remark" jdbcType="VARCHAR"/>
+    </resultMap>
+
 
-    <select id="selectDisburse" resultMap="BaseResultMap">
+    <select id="selectDisburse" resultMap="InvAccountOperateVoResultMap">
         SELECT DISTINCT
-            a.excel_account_operate_id,
-            a.apply_time,
+            a.account_operate_id,
+            DATE_FORMAT(a.create_time, '%Y-%m-%d') as create_date,
             a.fund_use,
             a.remark,
             a.apply_amount,
             a.apply_sector,
             a.company,
-            a.collection_message
-        from inv_account_excel a
+            a.collection_message,
+            a.create_time
+        from inv_account_operate a
             LEFT JOIN inv_account_expenses b ON a.fund_fen = b.category
         WHERE
             a.fund_use != '往来款'
 	    AND collection_message LIKE '外部用户%'
+        and a.revenue_outlay = '1'
         AND a.del_flag = '0'
-        <if test="insAccountExcel.applyTimeStart!= null">
-            and apply_time &gt;= #{insAccountExcel.applyTimeStart}
+        <if test="inAccountOperateVo.createTimeStart!= null">
+            and a.create_time &gt;= #{inAccountOperateVo.createTimeStart}
         </if>
-        <if test="insAccountExcel.applyTimeEnd!= null">
-            and apply_time &lt;= #{insAccountExcel.applyTimeEnd}
+        <if test="inAccountOperateVo.createTimeEnd!= null">
+            and a.create_time &lt;= #{inAccountOperateVo.createTimeEnd}
         </if>
-        <if test="insAccountExcel.applySector!= null and insAccountExcel.applySector!= ''">
-            and apply_sector = #{insAccountExcel.applySector}
+        <if test="inAccountOperateVo.applySector!= null and inAccountOperateVo.applySector!= ''">
+            and a.apply_sector = #{inAccountOperateVo.applySector}
         </if>
-        <if test="insAccountExcel.collectionMessage!= null and insAccountExcel.collectionMessage!= ''">
-            and collection_message like concat('%',#{insAccountExcel.collectionMessage},'%')
+        <if test="inAccountOperateVo.collectionMessage!= null and inAccountOperateVo.collectionMessage!= ''">
+            and a.collection_message like concat('%',#{inAccountOperateVo.collectionMessage},'%')
         </if>
-        <if test="insAccountExcel.company!= null and insAccountExcel.company!= ''">
-            and company like concat('%',#{insAccountExcel.company},'%')
+        <if test="inAccountOperateVo.company!= null and inAccountOperateVo.company!= ''">
+            and a.company like concat('%',#{inAccountOperateVo.company},'%')
         </if>
-        <if test="insAccountExcel.fundUse!= null and insAccountExcel.fundUse!= ''">
-            and fund_use = #{insAccountExcel.fundUse}
+        <if test="inAccountOperateVo.fundUse!= null and inAccountOperateVo.fundUse!= ''">
+            and a.fund_use = #{inAccountOperateVo.fundUse}
         </if>
-        <if test="insAccountExcel.applyAmount!= null and insAccountExcel.applyAmount!= ''">
-            and apply_amount = #{insAccountExcel.applyAmount}
+        <if test="inAccountOperateVo.applyAmount!= null and inAccountOperateVo.applyAmount!= ''">
+            and a.apply_amount = #{inAccountOperateVo.applyAmount}
         </if>
-        order by apply_time desc
+        order by a.create_time desc
     </select>
 </mapper>

+ 4 - 1
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -136,7 +136,8 @@
         sd.management_source,
         su2.name AS auditUser,
         ifa.audittime as auditTime,
-        ifa.auditstatus as auditStatus
+        ifa.auditstatus as auditStatus,
+        eic.namesimple as partnerCompaniesName
         FROM
         ins_orders io
         LEFT JOIN ins_fee_audit ifa ON ifa.orderno = io.orderno
@@ -144,6 +145,8 @@
         LEFT JOIN sys_dept sd ON sd.id = su.dept_id
         LEFT JOIN sys_user su2 ON ifa.audituser = su2.id
         LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno and iac.orderstatus = 3
+        LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
+        LEFT JOIN esm_ins_company eic on eic.id = pa.partner_companies_id
         WHERE
         io.orderno IN ( SELECT orderno FROM ins_area_company WHERE id IN (
         SELECT ins_order_no FROM ins_fee_order_new

+ 5 - 2
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -44,7 +44,7 @@
         <result property="subOrderId" column="subOrderId" jdbcType="VARCHAR"/>
         <result property="agreementCode" column="agreementCode" jdbcType="VARCHAR"/>
         <result property="agreementName" column="agreementName" jdbcType="VARCHAR"/>
-
+        <result property="partnerCompaniesName" column="partnerCompaniesName" jdbcType="VARCHAR"/>
     </resultMap>
     <resultMap id="OrderResultMap" type="com.ydtech.modules.order.entity.vo.OrderVo">
         <id property="orderno" column="orderno" jdbcType="VARCHAR"/>
@@ -811,13 +811,16 @@
         iac.company_id as company_id,
         iac.inscompany as ins_company,
         agree.agreement_code as agreementCode,
-        agree.agreement_name as agreementName
+        agree.agreement_name as agreementName,
+        company.namesimple as partnerCompaniesName
         from
             ins_area_company iac
         left JOIN
              ins_orders io  on iac.orderno = io.orderno
         left join
             ptl_agreement   agree  on  iac.agreement_id= agree.id
+        left join
+           esm_ins_company   company  on  agree.partner_companies_id= company.id
         <where>
             <if test="agentUserIds != null and agentUserIds.size>0" >
                 AND (