Pārlūkot izejas kodu

1.保险手续费查询条件调整

wuhp 2 gadi atpakaļ
vecāks
revīzija
ba22ea81b2

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

@@ -435,6 +435,10 @@ public class InsPlyIncome implements Serializable {
     @TableField(exist = false)
     private BigDecimal taxPoints;
 
+    @ApiModelProperty("税费")
+    @TableField(exist = false)
+    private BigDecimal taxesFees;
+
     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;

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

@@ -604,6 +604,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         if(!CollectionUtils.isEmpty(insPlyIncomeVo.getSelectIds())){
             params.put("selectIds",insPlyIncomeVo.getSelectIds());
         }
+        if(!CollectionUtils.isEmpty(insPlyIncomeVo.getPartnerCompaniesIdList())){
+            params.put("partnerCompaniesIdList",insPlyIncomeVo.getPartnerCompaniesIdList());
+        }
+
         return params;
     }
 
@@ -1493,7 +1497,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         settlementDocumentaryFeesVo.setIsNotCar(insPlyIncomeVo.getIsNotCar()); // 是否是非车
         settlementDocumentaryFeesVo.setInvoicingMethod(insPlyIncomeVo.getInvoicingMethod());  //开票方式
         settlementDocumentaryFeesVo.setTaxPoints(insPlyIncomeVo.getTaxPoints());  //税点
-        settlementDocumentaryFeesVo.setExpendAmount(insPlyIncomeVo.getExpendAmount()); //税点支出
+//        settlementDocumentaryFeesVo.setExpendAmount(insPlyIncomeVo.getExpendAmount()); //税点支出
         settlementDocumentaryFeesVo.setTotalAmount(insPlyIncomeVo.getInvoicCommissionFeevalue());
         settlementDocumentaryFeesVo.setHandlingFeesStatus("0");
         settlementDocumentaryFeesVo.setParentId(insPlyIncomeVo.getId());

+ 2 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java

@@ -319,4 +319,6 @@ public class InsPlyIncomeVo implements Serializable {
 
     @ApiModelProperty("跟单结算")
     private String settleOtherStatus;
+    @ApiModelProperty("合作公司idList")
+    private List<String> partnerCompaniesIdList;
 }

+ 44 - 2
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -217,6 +217,13 @@
                     </foreach>
                 </if>
 
+                <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
+                    and a.partner_companies_id in
+                    <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
                 <if test="isOther !=null  and  isOther  !=''">
                     and a.is_not_documentary   =#{isOther}
                 </if>
@@ -270,7 +277,10 @@
                   AND  a.insured_name =#{insuredName}
                 </if>
                 <if test="jqStartDate  !=null  and  jqStartDate  != ''  and  jqEndDate   != null  and  jqEndDate   !=''">
-                   AND (a.jq_start_date  )
+                   AND a.jq_end_date BETWEEN #{jqStartDate} AND #{jqEndDate}  AND a.jq_start_date &gt; = #{jqStartDate}
+                </if>
+                <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
+                   AND a.sy_start_date BETWEEN #{syStartDate} AND #{syEndDate}  AND a.sy_start_date &gt; = #{syStartDate}
                 </if>
 
             </where>
@@ -615,6 +625,12 @@
                 <if test="isNotCar !=null  and  isNotCar  !=''">
                     and a.is_not_car =#{isNotCar}
                 </if>
+                <if test="jqStartDate  !=null  and  jqStartDate  != ''  and  jqEndDate   != null  and  jqEndDate   !=''">
+                    AND a.jq_end_date BETWEEN #{jqStartDate} AND #{jqEndDate}  AND a.jq_start_date &gt; = #{jqStartDate}
+                </if>
+                <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
+                    AND a.sy_start_date BETWEEN #{syStartDate} AND #{syEndDate}  AND a.sy_start_date &gt; = #{syStartDate}
+                </if>
 
                 <if test="isOther !=null  and  isOther  !=''">
                     and a.is_not_documentary   =#{isOther}
@@ -623,6 +639,24 @@
                     and a.licenseno  =#{licenseno}
                 </if>
 
+                <if test="deptId !=null  and  deptId  !=''">
+                    and pa.dept_id =#{deptId}
+                </if>
+
+
+                <if test="ids != null and ids != '' and ids.length > 0">
+                    and a.id in
+                    <foreach collection="ids" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
+                <if test="selectIds != null and selectIds != '' and selectIds.size() > 0">
+                    and a.id in
+                    <foreach collection="selectIds" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
                 <if test="syPolicyno != null and syPolicyno != ''  ">
                     and a.sy_policyno =#{syPolicyno}
                 </if>
@@ -669,6 +703,12 @@
                 <if test="insuredName !=null  and  insuredName !=''">
                     AND  a.insured_name =#{insuredName}
                 </if>
+                <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
+                    and a.partner_companies_id in
+                    <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
             </where>
     </select>
 
@@ -809,6 +849,8 @@
         IFNULL ( max(d.settleMentAmount),0.00) as "invoicCommissionFeevalue",
         sum(COALESCE( a.commission_feevalue,0.00) )-IFNULL ( max(d.settleMentAmount),0.00)  as "noInvoicCommissionFeevalue",
         sum(COALESCE( a.commission_feevalue,0.00) )-COALESCE(max(c.settleMentAmount),0.00)+IFNULL ( max(d.settleMentAmount),0.00)  AS "unSettledAmount",
+        IFNULL(MAX(f.expendAmount),0.00) as   "expendAmount",
+        MAX(COALESCE( f.settleMentAmount,0.00) )-IFNULL ( max(f.expendAmount),0.00)  as "taxesFees",
         sum( a.commission_feevalue ) AS "commissionFeevalue"
         FROM
         ins_ply_income a
@@ -832,7 +874,7 @@
         GROUP BY partner_companies_id
         ) d ON d.partnerCompaniesId = a.partner_companies_id
         LEFT JOIN ( SELECT a.partner_companies_id AS "partnerCompaniesId",sum(
-        settlement_amount ) AS "settleMentAmount" FROM settlement_documentary_fees a
+        settlement_amount ) AS "settleMentAmount" , sum(a.expend_amount) as  "expendAmount", sum(a.tax_points ) as "taxPoints" FROM settlement_documentary_fees a
         WHERE a.settlement_status = '2'
         and  a.handling_fees_status ='0'
         <if test="isNotCar !=null  and  isNotCar  !=''">