Просмотр исходного кода

1.月份显示合计平台私有应收 未收

wuhp 2 лет назад
Родитель
Сommit
e43b75e0f2

+ 2 - 0
src/main/java/com/ydtech/modules/fnc/dao/SettlementDocumentaryFeesMapper.java

@@ -39,4 +39,6 @@ public interface SettlementDocumentaryFeesMapper  extends BaseMapper<SettlementD
     List<SettlementDocumentaryFeesEntity> getRecord(@Param("id") String id);
     List<SettlementDocumentaryFeesEntity> getRecord(@Param("id") String id);
 
 
     List<SettlementDocumentaryFeesEntity> queryRecord(SettlementDocumentaryFeesVo settlementDocumentaryFeesVo);
     List<SettlementDocumentaryFeesEntity> queryRecord(SettlementDocumentaryFeesVo settlementDocumentaryFeesVo);
+
+    List<HashMap<String, Object>> bxSumGroupByMonth(HashMap<String, Object> params);
 }
 }

+ 7 - 0
src/main/java/com/ydtech/modules/fnc/service/SettlementDocumentaryFeesService.java

@@ -38,4 +38,11 @@ public interface SettlementDocumentaryFeesService extends IService<SettlementDoc
     HttpResult<List<SettlementDocumentaryFeesEntity>> getRecord(String id);
     HttpResult<List<SettlementDocumentaryFeesEntity>> getRecord(String id);
 
 
     HttpResult<List<SettlementDocumentaryFeesEntity>> queryRecord(SettlementDocumentaryFeesVo settlementDocumentaryFeesVo);
     HttpResult<List<SettlementDocumentaryFeesEntity>> queryRecord(SettlementDocumentaryFeesVo settlementDocumentaryFeesVo);
+    /**
+     *
+     * @param params   settlementStatus  2   已结算
+     * @return   按照月分组  已收款金额
+     */
+    List<HashMap<String, Object>> bxSumGroupByMonth(HashMap<String, Object> params);
+
 }
 }

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

@@ -2909,15 +2909,13 @@ handlingProportion,
      */
      */
 
 
     @Override
     @Override
-    public HttpResult<List<HashMap<String,Object>>> monthTotalReceivables(InsPlyIncomeVo insPlyIncomeVo) {
-
+    public HttpResult<List<HashMap<String, Object>>> monthTotalReceivables(InsPlyIncomeVo insPlyIncomeVo) {
         HashMap<String, Object> params = new HashMap<>();
         HashMap<String, Object> params = new HashMap<>();
         params.put("agreementType", insPlyIncomeVo.getAgreementType());
         params.put("agreementType", insPlyIncomeVo.getAgreementType());
         if ("1".equals(insPlyIncomeVo.getAgreementType())) {  //平台
         if ("1".equals(insPlyIncomeVo.getAgreementType())) {  //平台
             params.put("year", insPlyIncomeVo.getYear());
             params.put("year", insPlyIncomeVo.getYear());
             List<HashMap<String, Object>> ptResultList = baseMapper.ptSumGroupByMonth(params);
             List<HashMap<String, Object>> ptResultList = baseMapper.ptSumGroupByMonth(params);
             params.put("handlingFeesStatus", "1");
             params.put("handlingFeesStatus", "1");
-
             List<HashMap<String, Object>> ptSettleResultList = baseMapper.ptSumGroupByMonth(params);
             List<HashMap<String, Object>> ptSettleResultList = baseMapper.ptSumGroupByMonth(params);
             Map<String, BigDecimal> ptMap = new HashMap<>(); // 假设commissionFeevalue是BigDecimal类型
             Map<String, BigDecimal> ptMap = new HashMap<>(); // 假设commissionFeevalue是BigDecimal类型
             for (HashMap<String, Object> ptSettleResultListItem : ptSettleResultList) {
             for (HashMap<String, Object> ptSettleResultListItem : ptSettleResultList) {
@@ -2935,12 +2933,40 @@ handlingProportion,
             }
             }
             for (HashMap<String, Object> ptResultListItem : ptResultList) {
             for (HashMap<String, Object> ptResultListItem : ptResultList) {
                 BigDecimal bigDecimal1 = ptMap.get(ptResultListItem.get("year"));
                 BigDecimal bigDecimal1 = ptMap.get(ptResultListItem.get("year"));
-                ptResultListItem.put("readyCommissionFeevalue",bigDecimal1);
+                ptResultListItem.put("readyCommissionFeevalue", bigDecimal1);
                 BigDecimal commissionFeevalue = BigDecimal.valueOf(Long.valueOf(ptResultListItem.get("commissionFeevalue").toString()));
                 BigDecimal commissionFeevalue = BigDecimal.valueOf(Long.valueOf(ptResultListItem.get("commissionFeevalue").toString()));
                 BigDecimal subtract = commissionFeevalue.subtract(bigDecimal1);
                 BigDecimal subtract = commissionFeevalue.subtract(bigDecimal1);
-                ptResultListItem.put("noInvoicCommissionFeevalue",subtract);
+                ptResultListItem.put("noInvoicCommissionFeevalue", subtract);
             }
             }
             return HttpResult.ok(ptResultList);
             return HttpResult.ok(ptResultList);
+        } else if ("2".equals(insPlyIncomeVo.getAgreementType())) {
+            params.put("year", insPlyIncomeVo.getYear());
+            List<HashMap<String, Object>> bxResultList = baseMapper.ptSumGroupByMonth(params);
+            params.clear();
+            params.put("settlementStatus", "2");
+            List<HashMap<String, Object>> bxReadyCommissionFeevalue = settlementDocumentaryFeesService.bxSumGroupByMonth(params);
+            Map<String, BigDecimal> bxMap = new HashMap<>(); // 假设commissionFeevalue是BigDecimal类型
+            for (HashMap<String, Object> bxSettleResultListItem : bxReadyCommissionFeevalue) {
+                String month = (String) bxSettleResultListItem.get("month");
+                if (month == null) {
+                    // 处理month为null的情况
+                    continue;
+                }
+                BigDecimal commissionFeevalue = (BigDecimal) bxSettleResultListItem.get("commissionFeevalue");
+                if (commissionFeevalue == null) {
+                    // 处理commissionFeevalue为null的情况
+                    continue;
+                }
+                bxMap.put(month, commissionFeevalue);
+            }
+            for (HashMap<String, Object> bxResultListItem : bxResultList) {
+                BigDecimal bigDecimal1 = bxMap.get(bxResultListItem.get("year"));
+                bxResultListItem.put("readyCommissionFeevalue", bigDecimal1);
+                BigDecimal commissionFeevalue = BigDecimal.valueOf(Long.valueOf(bxResultListItem.get("commissionFeevalue").toString()));
+                BigDecimal subtract = commissionFeevalue.subtract(bigDecimal1);
+                bxResultListItem.put("noInvoicCommissionFeevalue", subtract);
+            }
+            return HttpResult.ok(bxReadyCommissionFeevalue);
         }
         }
         return HttpResult.ok();
         return HttpResult.ok();
     }
     }

+ 10 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/SettlementDocumentaryFeesServiceImpl.java

@@ -253,6 +253,16 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
         return  HttpResult.ok(settlementDocumentaryFeesEntities);
         return  HttpResult.ok(settlementDocumentaryFeesEntities);
     }
     }
 
 
+    /**
+     *
+     * @param params   settlementStatus  2   已结算
+     * @return   按照月分组  已收款金额
+     */
+    @Override
+    public List<HashMap<String, Object>> bxSumGroupByMonth(HashMap<String, Object> params) {
+        return  baseMapper.bxSumGroupByMonth(params);
+    }
+
     private int compareAmount(BigDecimal settlementAmount, BigDecimal settlementAmount1) {
     private int compareAmount(BigDecimal settlementAmount, BigDecimal settlementAmount1) {
 
 
         return settlementAmount.compareTo(settlementAmount1);
         return settlementAmount.compareTo(settlementAmount1);

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

@@ -1972,6 +1972,7 @@
                 LEFT JOIN esm_ins_company eic ON eic.id = a.partner_companies_id
                 LEFT JOIN esm_ins_company eic ON eic.id = a.partner_companies_id
                 LEFT JOIN sys_dept b ON pa.dept_id = b.id
                 LEFT JOIN sys_dept b ON pa.dept_id = b.id
         <where>
         <where>
+            1=1
             <if test="startDate !=null  and  startDate!='' and  endDate !=null and endDate !=''">
             <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')
                 and DATE_FORMAT( a.signdate, '%Y-%m-%d')  between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
             </if>
             </if>

+ 37 - 0
src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml

@@ -397,6 +397,43 @@
     </select>
     </select>
 
 
 
 
+    <select id="bxSumGroupByMonth" resultType="java.util.HashMap">
+        SELECT
+        DATE_FORMAT( a.signing_time, '%m') as "month",
+        sum(a.settlement_amount) as "commissionFeevalue"
+        from  settlement_documentary_fees  a
+        LEFT  JOIN   ins_upload_files  upf   on  a.settlement_image_id=upf.id
+        <where>
+            1=1
+            <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                and a.partner_companies_id =#{partnerCompaniesId}
+            </if>
+            <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                and a.handling_fees_status =#{handlingFeesStatus}
+            </if>
+            <if test="isNotCar !=null  and  isNotCar  !=''">
+                and a.is_not_car =#{isNotCar}
+            </if>
+            <if test="agreementType !=null  and  agreementType  !=''">
+                and a.agreement_type =#{agreementType}
+            </if>
+            <if test="parentId !=null  and  parentId  !=''">
+                and a.parent_id =#{parentId}
+            </if>
+            <if test="settlementStatus !=null  and  settlementStatus  !=''">
+                and a.settlement_status =#{settlementStatus}
+            </if>
+            <if test="completionStatus !=null  and  completionStatus  !=''">
+                and a.completion_status =#{completionStatus}
+            </if>
+            <if test="settlementSumId !=null  and  settlementSumId  !=''">
+                and a.settlement_sum_id =#{settlementSumId}
+            </if>
+        </where>
+        GROUP BY
+        DATE_FORMAT( a.signing_time, '%m')
+    </select>
+