فهرست منبع

1.资产、个贷、大中型待认领实收款查询新增 收款状态 查询条件
2.认领收款推荐排除已有实收款的订单
3.资产我的订单查询实际开票金额逻辑修改

GouGengquan 10 ماه پیش
والد
کامیت
9ef5d98d2e

+ 2 - 2
dao/src/main/resources/mapper/AssetsMapper.xml

@@ -205,7 +205,7 @@
         pFund.production_should_amount,
         pFund.real_amount AS productionRealAmount,
         # invoice.real_amount AS invoiceRealAmount,
-        (SELECT SUM(real_amount) FROM finance_invoice WHERE order_fund_id = fund.id AND deleted = 0) AS invoiceRealAmount,
+        (SELECT SUM(real_amount) FROM finance_invoice WHERE order_fund_id = fund.id AND finance_invoice.production_fund_id = pFund.id AND deleted = 0) AS invoiceRealAmount,
         #查询客户经理
         (SELECT name FROM user WHERE id = assets.client_manager_id) AS clientManagerName,
         #查询项目负责人
@@ -309,7 +309,7 @@
         fund.id AS orderFundId,
         fund.should_amount,
         fund.real_amount,
-        fund.discount,
+#         fund.discount,
         pFund.standard_amount,
 #         invoice.real_amount AS invoiceRealAmount,
         (SELECT SUM(real_amount) FROM finance_invoice WHERE order_fund_id = fund.id AND deleted = 0) AS invoiceRealAmount,

+ 1 - 0
dao/src/main/resources/mapper/AssetsProductionMapper.xml

@@ -249,6 +249,7 @@
         WHERE production.production_type != 'STATEMENT'
         AND assets.client_manager_id = #{managerId}
         AND production.create_production_date IS NOT NULL
+        AND IF(#{apFundSelectDTO.hasRealAmount}, pFund.real_amount IS NOT NULL, pFund.real_amount IS NULL)
         <if test="apFundSelectDTO.keyWord != null and apFundSelectDTO.keyWord != ''">
             AND production.assets_name LIKE CONCAT('%',#{apFundSelectDTO.keyWord},'%')
         </if>

+ 2 - 0
dao/src/main/resources/mapper/FinanceRealFundMapper.xml

@@ -162,6 +162,7 @@
         FROM
             (
                 SELECT
+                    order_fund.real_amount,
                     order_fund.business_type,
                     temp.invoiceAmount
                 FROM
@@ -199,6 +200,7 @@
             ) tt1
         WHERE
             tt1.invoiceAmount = #{amount}
+        AND tt1.real_amount IS NULL
     </select>
 
     <select id="getNotClaimAmount" parameterType="java.lang.Long" resultType="java.math.BigDecimal">

+ 1 - 0
dao/src/main/resources/mapper/MajorProductionMapper.xml

@@ -670,6 +670,7 @@
             m.deleted = 0
           AND	mp.deleted = 0
           AND m.client_manager_id = #{vo.clientManagerId}
+          AND IF(#{vo.hasRealAmount}, off.real_amount IS NOT NULL, off.real_amount IS NULL)
             and off.production_should_amount>0
         <if test="vo!=null and vo.name!=null and vo.name !=''">
             and mp.name like concat ('%',#{vo.name},'%')

+ 1 - 0
dao/src/main/resources/mapper/PersonalMapper.xml

@@ -355,6 +355,7 @@
         left join (select sum(real_amount) as invoiceAmount,order_fund_id from finance_invoice where state ='已开票' and deleted = 0 GROUP BY order_fund_id) fi on fi.order_fund_id = o.id
         where
             p.deleted = 0  and p.client_manager_id = #{personal.clientManagerId}
+          AND IF(#{personal.hasRealAmount}, o.real_amount IS NOT NULL, o.real_amount IS NULL)
         <if test="keyword!=null and keyword!='' ">
             and  p.location like concat ('%',#{keyword},'%')
         </if>

+ 5 - 0
domain/src/main/java/com/dayou/dto/APFundSelectDTO.java

@@ -37,6 +37,11 @@ public class APFundSelectDTO {
      */
     private String reportNo;
 
+    /**
+     * 是否有实收款
+     */
+    private Boolean hasRealAmount;
+
     private BigDecimal invoiceAmount;
 
 }

+ 5 - 0
domain/src/main/java/com/dayou/vo/MajorProductionVO.java

@@ -154,6 +154,11 @@ public class MajorProductionVO {
 
     private String businessType;
 
+    /**
+     * 是否有实收款
+     */
+    private Boolean hasRealAmount;
+
     private BigDecimal orderShouldAmount;
 
     private BigDecimal invoiceAmount;

+ 5 - 0
domain/src/main/java/com/dayou/vo/PersonalVO.java

@@ -167,6 +167,11 @@ public class PersonalVO extends Personal {
     private BigDecimal invoiceAmountCondition;
 
     /**
+     * 是否有实收款
+     */
+    private Boolean hasRealAmount;
+
+    /**
      * 开票金额
      */
     @Excel(name = "开票金额")