Prechádzať zdrojové kódy

财务统计数据查询修改

wucl 6 mesiacov pred
rodič
commit
803ae4ee07
27 zmenil súbory, kde vykonal 664 pridanie a 302 odobranie
  1. 7 0
      biz-base/src/main/java/com/dayou/controller/DyoaController.java
  2. 4 4
      biz-base/src/main/java/com/dayou/controller/FinanceRealFundController.java
  3. 9 5
      biz-base/src/test/java/dyoa/DyoaHistoryDataTest.java
  4. 4 0
      dao/src/main/java/com/dayou/mapper/DictDataMapper.java
  5. 8 0
      dao/src/main/java/com/dayou/mapper/DyoaHistoryMapper.java
  6. 2 0
      dao/src/main/java/com/dayou/mapper/DyoaRecordMapper.java
  7. 16 0
      dao/src/main/resources/mapper/DictDataMapper.xml
  8. 25 0
      dao/src/main/resources/mapper/DyoaHistoryMapper.xml
  9. 4 0
      dao/src/main/resources/mapper/DyoaRecordMapper.xml
  10. 11 14
      dao/src/main/resources/mapper/FinanceClaimMapper.xml
  11. 326 260
      dao/src/main/resources/mapper/FinanceRealFundMapper.xml
  12. 11 0
      domain/src/main/java/com/dayou/dto/history/CommissionRate.java
  13. 25 0
      domain/src/main/java/com/dayou/dto/history/HisCommissionDeclare.java
  14. 2 0
      domain/src/main/java/com/dayou/vo/RealFundPersonalVO.java
  15. 175 0
      service/src/main/java/com/dayou/dyoa/DyoaHistoryServiceImpl.java
  16. 2 0
      service/src/main/java/com/dayou/dyoa/IDyoaHistoryService.java
  17. 7 0
      service/src/main/java/com/dayou/dyoa/task/FetchDyoaDataSchedule.java
  18. 3 3
      service/src/main/java/com/dayou/processor/AppBootProcessor.java
  19. 2 0
      service/src/main/java/com/dayou/service/IDictDataService.java
  20. 1 0
      service/src/main/java/com/dayou/service/IDyoaRecordService.java
  21. 1 1
      service/src/main/java/com/dayou/service/IPersonalProductionService.java
  22. 2 0
      service/src/main/java/com/dayou/service/impl/BusinessCommissionRateServiceImpl.java
  23. 2 0
      service/src/main/java/com/dayou/service/impl/CommissionDeclareServiceImpl.java
  24. 7 0
      service/src/main/java/com/dayou/service/impl/DictDataServiceImpl.java
  25. 4 0
      service/src/main/java/com/dayou/service/impl/DyoaRecordServiceImpl.java
  26. 2 0
      service/src/main/java/com/dayou/service/impl/MajorProductionAllotServiceImpl.java
  27. 2 15
      service/src/main/java/com/dayou/service/impl/PersonalProductionServiceImpl.java

+ 7 - 0
biz-base/src/main/java/com/dayou/controller/DyoaController.java

@@ -88,4 +88,11 @@ public class DyoaController {
         Boolean ret = dyoaHistoryService.updateMajorProduction();
         return RestResponse.data(ret);
     }
+
+    @IgnoreAuth
+    @GetMapping("/update/majorCommission")
+    public RestResponse<Boolean> updateMajorCommission(){
+        Boolean ret = dyoaHistoryService.updateCommissionDeclare();
+        return RestResponse.data(ret);
+    }
 }

+ 4 - 4
biz-base/src/main/java/com/dayou/controller/FinanceRealFundController.java

@@ -138,8 +138,8 @@ public class FinanceRealFundController extends BaseController {
     @GetMapping("/major/evaluator/settle/export")
     public void majorEvaluatorSettleExport(SettleMajorProductionVO production,Page page, HttpServletResponse response,String keyword) throws IOException, NoSuchFieldException, IllegalAccessException {
         List<SettleMajorProductionVO> result = financeRealFundService.majorEvaluatorSettleExport(production,page,keyword);
-//        exportPlus(response,"大中型评估人员结算项目",result, SettleMajorProductionVO.class);
-        ExcelOneToManyExportUtils.exportOneToMany(response,result, SettleMajorProductionVO.class, SettleProInvoiceVo.class,"大中型评估人员结算项目", "invoices");
+        exportPlus(response,"大中型评估人员结算项目",result, SettleMajorProductionVO.class);
+//        ExcelOneToManyExportUtils.exportOneToMany(response,result, SettleMajorProductionVO.class, SettleProInvoiceVo.class,"大中型评估人员结算项目", "invoices");
     }
 
     /**
@@ -162,8 +162,8 @@ public class FinanceRealFundController extends BaseController {
     @GetMapping("/major/market/settle/export")
     public void majorMarketSettleExport(SettleMajorProductionVO production,Page page, HttpServletResponse response,String keyword) throws IOException, NoSuchFieldException, IllegalAccessException {
         List<SettleMajorProductionVO> result = financeRealFundService.majorMarketSettleExport(production,page,keyword);
-//        exportPlus(response,"大中型市场人员结算项目",result, SettleMajorProductionVO.class);
-        ExcelOneToManyExportUtils.exportOneToMany(response,result, SettleMajorProductionVO.class, SettleProInvoiceVo.class,"大中型市场人员结算项目", "invoices");
+        exportPlus(response,"大中型市场人员结算项目",result, SettleMajorProductionVO.class);
+//        ExcelOneToManyExportUtils.exportOneToMany(response,result, SettleMajorProductionVO.class, SettleProInvoiceVo.class,"大中型市场人员结算项目", "invoices");
     }
 
     /**

+ 9 - 5
biz-base/src/test/java/dyoa/DyoaHistoryDataTest.java

@@ -19,12 +19,16 @@
 //    @Autowired
 //    private IDyoaHistoryService dyoaHistoryService;
 //
+////    @Test
+////    public void getMajorOrder(){
+////        Map<String, Object> resultMap = dyoaHistoryService.queryMajorOrder("597848672822104064");
+////        for (Map.Entry<String, Object> entry : resultMap.entrySet()) {
+////           log.info(entry.getKey() + "=" + entry.getValue());
+////        }
+////    }
 //    @Test
-//    public void getMajorOrder(){
-//        Map<String, Object> resultMap = dyoaHistoryService.queryMajorOrder("597848672822104064");
-//        for (Map.Entry<String, Object> entry : resultMap.entrySet()) {
-//           log.info(entry.getKey() + "=" + entry.getValue());
-//        }
+//    public void updateCommission(){
+//        Boolean b = dyoaHistoryService.updateCommissionDeclare();
 //    }
 //
 //

+ 4 - 0
dao/src/main/java/com/dayou/mapper/DictDataMapper.java

@@ -4,6 +4,8 @@ import com.dayou.entity.DictData;
 import com.dayou.dao.CustomBaseMapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  * 字典数据 Mapper 接口
@@ -15,4 +17,6 @@ import org.apache.ibatis.annotations.Param;
 public interface DictDataMapper extends CustomBaseMapper<DictData> {
 
     DictData findByDataTypeAndName(@Param("dataType") String dataType, @Param("remark") String remark);
+
+    List<DictData> findByDataTypeByCode(@Param("code")String code);
 }

+ 8 - 0
dao/src/main/java/com/dayou/mapper/DyoaHistoryMapper.java

@@ -1,6 +1,8 @@
 package com.dayou.mapper;
 
+import com.dayou.dto.history.CommissionRate;
 import com.dayou.dto.history.HisAssetsProduction;
+import com.dayou.dto.history.HisCommissionDeclare;
 import com.dayou.dto.history.HisMajorProduction;
 import org.apache.ibatis.annotations.Param;
 
@@ -47,4 +49,10 @@ public interface DyoaHistoryMapper {
     Map<String, Object> getInvoiceInfo(@Param("id") String id);
 
     List<HisMajorProduction> findAllProductionNo();
+
+    List<HisCommissionDeclare> findCommissionDeclareInDyOA();
+
+    List<CommissionRate> findPgRate(@Param("id")String id);
+
+    List<CommissionRate> findScRate(@Param("id")String id);
 }

+ 2 - 0
dao/src/main/java/com/dayou/mapper/DyoaRecordMapper.java

@@ -3,6 +3,7 @@ package com.dayou.mapper;
 import com.dayou.entity.DyoaRecord;
 import com.dayou.dao.CustomBaseMapper;
 import com.dayou.entity.OrderFund;
+import org.apache.ibatis.annotations.Param;
 
 import java.time.LocalDate;
 import java.util.Date;
@@ -32,4 +33,5 @@ public interface DyoaRecordMapper extends CustomBaseMapper<DyoaRecord> {
     Date getMaxFinanceInvoiceCreatedTime();
 
 
+    Long getMbsIdByDyOAId(@Param("id") String id);
 }

+ 16 - 0
dao/src/main/resources/mapper/DictDataMapper.xml

@@ -42,4 +42,20 @@
           AND dd.deleted = 0
     </select>
 
+    <select id="findByDataTypeByCode" parameterType="java.lang.String" resultType="com.dayou.entity.DictData">
+        SELECT
+            dd.id,
+            dd.dict_type_id,
+            dd.NAME,
+            dd.remark,
+            dd.enabled
+        FROM
+            dict_type dt
+                LEFT JOIN dict_data dd ON dd.dict_type_id = dt.id
+        WHERE
+            dt.`code` = #{code}
+
+          AND dd.enabled = 1
+          AND dd.deleted = 0
+    </select>
 </mapper>

+ 25 - 0
dao/src/main/resources/mapper/DyoaHistoryMapper.xml

@@ -458,4 +458,29 @@
         left join dy_order_product dop on dop.orderId = d.id and d.deleted = 0 where d.reportNO is not null
 
     </select>
+
+    <select id="findCommissionDeclareInDyOA" resultType="com.dayou.dto.history.HisCommissionDeclare">
+        SELECT
+            id,
+            masterName,
+            managerName,
+            reportNO,
+            masterApproveStatus,
+            masterBusinessType,
+            pgApproveStatus,
+            pgBusinessType,
+            (case nowProduct when '报告' then 'REPORT' WHEN '价值意见书' then 'STATEMENT' ELSE '' END ) production
+        FROM
+            dy_order
+        WHERE
+            deleted = 0
+    </select>
+
+    <select id="findPgRate" parameterType="java.lang.String" resultType="com.dayou.dto.history.CommissionRate">
+        select orderRate as rate,empName as name from dy_order_performance where orderId = #{id}
+    </select>
+
+    <select id="findScRate" parameterType="java.lang.String" resultType="com.dayou.dto.history.CommissionRate">
+        select bonusRate as rate,empName as name from dy_order_master where orderId = #{id}
+    </select>
 </mapper>

+ 4 - 0
dao/src/main/resources/mapper/DyoaRecordMapper.xml

@@ -65,4 +65,8 @@
         select max(order_datetime) from dyoa_record where mbs_type = 'FINANCE_INVOICE'
     </select>
 
+    <select id="getMbsIdByDyOAId" parameterType="java.lang.String" resultType="java.lang.Long">
+        select mbs_id from dyoa_record where dyoa_id = #{id} and  mbs_type = 'MAJOR_ORDER'
+    </select>
+
 </mapper>

+ 11 - 14
dao/src/main/resources/mapper/FinanceClaimMapper.xml

@@ -104,7 +104,10 @@
         WHERE
         id IN ( SELECT post_id FROM user_post WHERE user_id = u.id ))) AS marketDepartment
         FROM
-        finance_claim fc
+        (select * from finance_claim where deleted = 0 and production_fund_id is not null
+        AND claim_datetime &gt;= #{majorStat.startDate}
+        AND claim_datetime &lt;= #{majorStat.endDate}
+        ) fc
         INNER JOIN (
         SELECT
         p.order_fund_id oId,
@@ -116,7 +119,6 @@
         production_fund p
         WHERE
         p.business_type = 'MAJOR_BUSINESS'
-
         AND p.deleted = 0
         ) f ON ( fc.order_fund_id = f.oId AND fc.production_fund_id = f.pId )
         LEFT JOIN major m ON f.business_id = m.id
@@ -153,13 +155,6 @@
                 or u2.NAME like concat ('%',#{keyword},'%')
                 )
             </if>
-
-            <if test="majorStat!=null and majorStat.startDate!=null and majorStat.startDate!='' ">
-                and fc.claim_datetime &gt;= #{majorStat.startDate}
-            </if>
-            <if test="majorStat!=null and majorStat.endDate!=null and majorStat.endDate!='' ">
-                and fc.claim_datetime &lt;= #{majorStat.endDate}
-            </if>
             <if test="majorStat!=null and majorStat.payStartDate!=null and majorStat.payStartDate!='' ">
                 and frf.pay_datetime &gt;= #{majorStat.payStartDate}
             </if>
@@ -329,7 +324,12 @@
                     orderFund.business_type = 'PERSONAL_BUSINESS'
                   AND orderFund.deleted = 0
             ) f
-                INNER JOIN finance_claim fc ON fc.order_fund_id = f.oId
+                INNER JOIN
+                (select * from finance_claim where deleted = 0
+                AND claim_datetime &gt;= #{dto.startTime}
+                AND claim_datetime &lt;= #{dto.endTime}
+                )
+                fc ON fc.order_fund_id = f.oId
                 LEFT JOIN personal p ON f.business_id = p.id
                 LEFT JOIN user u ON u.id = p.client_manager_id
                 LEFT JOIN customer_company cc1 ON cc1.id = p.clientele_id
@@ -338,7 +338,7 @@
                 LEFT JOIN user u2 ON u2.id = fc.claim_user_id
                 LEFT JOIN personal_target pt ON pt.personal_id = p.id
         WHERE
-            p.deleted = 0
+            p.deleted = 0 and fc.deleted = 0
         <if test="dto != null and dto.orderId != null and dto.orderId != ''">
             AND p.order_id = #{dto.orderId}
         </if>
@@ -351,9 +351,6 @@
         <if test="dto != null and dto.ifSaveFile != null">
             AND p.if_save_file = #{dto.ifSaveFile}
         </if>
-        <if test="dto != null and dto.startTime != null and dto.endTime!= null">
-            AND (fc.claim_datetime BETWEEN #{dto.startTime} AND #{dto.endTime})
-        </if>
         <if test="dto != null and dto.payStartTime != null and dto.payEndTime!= null">
             AND (frf.pay_datetime BETWEEN #{dto.payStartTime} AND #{dto.payEndTime})
         </if>

+ 326 - 260
dao/src/main/resources/mapper/FinanceRealFundMapper.xml

@@ -356,104 +356,112 @@
         <result property="evaluateDepartmentName" column="evaluateDepartmentName" />
         <result property="marketDepartmentName" column="marketDepartmentName" />
         <result property="payDateTime" column="pay_datetime" />
-        <collection property="invoices" ofType="com.dayou.vo.SettleProInvoiceVo">
-            <result property="invoiceDate" column="invoiceDate" />
-            <result property="invoiceUser" column="invoiceUser" />
-            <result property="invoiceNo" column="invoiceNo" />
-        </collection>
+<!--        <collection property="invoices" ofType="com.dayou.vo.SettleProInvoiceVo">-->
+<!--            <result property="invoiceDate" column="invoiceDate" />-->
+<!--            <result property="invoiceUser" column="invoiceUser" />-->
+<!--            <result property="invoiceNo" column="invoiceNo" />-->
+<!--        </collection>-->
     </resultMap>
 
     <sql id="majorEvaluatorSettleSql">
         SELECT
-            fc.id,
-            fc.claim_amount,
-            m.order_id,
-            mp.report_no,
-            fc.claim_datetime as claimDate,
-            mp.save_file_date,
-            IF
-                ( fc.claim_datetime > mp.save_file_date, fc.claim_datetime, mp.save_file_date ) AS settleDate,
-            mp.name,
-            m.bailor,
-            mp.evaluate_amount,
-            u.name AS principal,
-            u1.name AS clientManager,
-            cc.name AS clientName,
-            cc1.name AS clientSubName,
-            d.name AS evaluateDepartmentName,
-            (
-                SELECT
-                    GROUP_CONCAT( name )
-                FROM
-                    department
-                WHERE
-                        id IN (
-                        SELECT
-                            department_id
-                        FROM
-                            post
-                        WHERE
-                            id IN ( SELECT post_id FROM user_post WHERE user_id = m.client_manager_id ))) AS marketDepartmentName,
-        invoice.name AS invoiceUser,
-        invoice.real_make_date AS invoiceDate,
-        invoice.tax_no AS invoiceNo,
+        fc.id,
+        fc.claim_amount,
+        m.order_id,
+        mp.report_no,
+        fc.claim_datetime as claimDate,
+        mp.save_file_date,
+        IF
+        ( fc.claim_datetime > mp.save_file_date, fc.claim_datetime, mp.save_file_date ) AS settleDate,
+        mp.name,
+        m.bailor,
+        mp.evaluate_amount,
+        u.name AS principal,
+        u1.name AS clientManager,
+        cc.name AS clientName,
+        cc1.name AS clientSubName,
+        d.name AS evaluateDepartmentName,
+        (
+        SELECT
+        GROUP_CONCAT( name )
+        FROM
+        department
+        WHERE
+        id IN (
+        SELECT
+        department_id
+        FROM
+        post
+        WHERE
+        id IN ( SELECT post_id FROM user_post WHERE user_id = m.client_manager_id ))) AS marketDepartmentName,
         frf.pay_datetime
         FROM
-            (
-                SELECT
-                    id,
-                    claim_amount,
-                    order_fund_id,
-                    production_fund_id,
-                    claim_datetime,
-                     real_fund_id
-                FROM
-                    finance_claim
-                WHERE
-                    deleted = 0
-                  AND production_fund_id IS NOT NULL
-                  AND claim_datetime &gt;= #{settleVO.startDate}
-                  AND claim_datetime  &lt;= #{settleVO.endDate} UNION ALL
-                SELECT id, allot_amount AS claim_amount, order_fund_id, production_fund_id, created AS claim_datetime,
-        real_fund_id FROM order_fund_allot WHERE deleted = 0
-                    AND created  &gt;= #{settleVO.startDate}
-                    AND created &lt;= #{settleVO.endDate}
-            ) fc
-                 inner join (
-            select id,pay_datetime from finance_real_fund
-            where deleted = 0
+        (
+        SELECT
+        id,
+        claim_amount,
+        order_fund_id,
+        production_fund_id,
+        claim_datetime,
+        real_fund_id
+        FROM
+        finance_claim
+        WHERE
+        deleted = 0
+        AND production_fund_id IS NOT NULL
+
+        ) fc
+        INNER JOIN ( SELECT id, pay_datetime FROM finance_real_fund WHERE deleted = 0
         <if test="settleVO!=null and settleVO.payStartDate!=null and settleVO.payStartDate!='' ">
             AND pay_datetime &gt;= #{settleVO.payStartDate}
         </if>
         <if test="settleVO!=null and settleVO.payEndDate!=null and settleVO.payEndDate!='' ">
             AND pay_datetime &lt;= #{settleVO.payEndDate}
         </if>
-        ) frf on frf.id = fc.real_fund_id
-                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-                INNER JOIN ( SELECT id, major_id, NAME, report_no, production, evaluate_amount, save_file_date FROM major_production WHERE deleted = 0 AND save_file_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
-                LEFT JOIN major m ON m.id = mp.major_id
-                LEFT JOIN user u ON u.id = m.principal_id
-                LEFT JOIN user u1 ON u1.id = m.client_manager_id
-                LEFT JOIN customer_company cc ON cc.id = m.clientele_id
-                LEFT JOIN customer_company cc1 ON cc1.id = m.clientele_sub_id
-                LEFT JOIN department d ON d.id = m.department_id
-                LEFT JOIN (
-                SELECT real_make_date, name, tax_no, order_fund_id, production_fund_id
-                FROM finance_invoice, user
-                WHERE maker_id = user.id
-                AND finance_invoice.deleted = 0
-                AND state = '已开票'
-                ) AS invoice ON IF(invoice.production_fund_id IS NOT NULL ,invoice.order_fund_id = pf.order_fund_id AND invoice.production_fund_id = pf.id,invoice.order_fund_id = pf.order_fund_id)
-                <where>
-                    <if test="keyword!=null and keyword!='' ">
-                        and (
-                        m.order_id = #{keyword}
-                        or mp.report_no like concat ('%',#{keyword},'%')
-                        or u.name like concat ('%',#{keyword},'%')
-                        or u1.name like concat ('%',#{keyword},'%')
-                        )
-                    </if>
-                </where>
+        ) frf ON frf.id = fc.real_fund_id
+        INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
+        INNER JOIN (
+        SELECT
+        id,
+        major_id,
+        NAME,
+        report_no,
+        production,
+        evaluate_amount,
+        save_file_date,
+        fund.real_amount
+        FROM
+        major_production mpr
+        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
+        WHERE
+        fund.real_amount IS NOT NULL
+        AND mpr.save_file_date IS NOT NULL
+        ) mp ON mp.report_no = pf.production_no
+        LEFT JOIN major m ON m.id = mp.major_id
+        LEFT JOIN user u ON u.id = m.principal_id
+        LEFT JOIN user u1 ON u1.id = m.client_manager_id
+        LEFT JOIN customer_company cc ON cc.id = m.clientele_id
+        LEFT JOIN customer_company cc1 ON cc1.id = m.clientele_sub_id
+        LEFT JOIN department d ON d.id = m.department_id
+        <where>
+            <if test="keyword!=null and keyword!='' ">
+                and (
+                mp.report_no like concat ('%',#{keyword},'%')
+                or fc.claim_amount =#{keyword}
+                or m.order_id like concat('%',#{keyword},'%')
+                or u.name like concat('%',#{keyword},'%')
+                or u1.name like concat('%',#{keyword},'%')
+                )
+            </if>
+            <if test="settleVO!=null and settleVO.startDate!=null and settleVO.startDate!='' ">
+                AND (select IF
+                ( fc.claim_datetime > mp.save_file_date, fc.claim_datetime, mp.save_file_date )) &gt;= #{settleVO.startDate}
+            </if>
+            <if test="settleVO!=null and settleVO.endDate!=null and settleVO.endDate!='' ">
+                AND (select IF
+                ( fc.claim_datetime > mp.save_file_date, fc.claim_datetime, mp.save_file_date )) &lt;= #{settleVO.endDate}
+            </if>
+        </where>
         order by fc.claim_datetime ASC
     </sql>
     <select id="majorEvaluatorSettleProd" parameterType="com.dayou.vo.SettleMajorProductionVO" resultMap="settleeMajorProductionVOMap">
@@ -466,95 +474,100 @@
 
     <sql id="majorMarketerSettleSql">
         SELECT
-            fc.id,
-            fc.claim_amount,
-            m.order_id,
-            mp.report_no,
-            fc.claim_datetime as claimDate,
-            mp.delivery_date as deliveryDate,
-            IF
-                ( fc.claim_datetime > mp.delivery_date, fc.claim_datetime, mp.delivery_date ) AS settleDate,
-            mp.NAME,
-            m.bailor,
-            mp.evaluate_amount,
-            u.NAME AS principal,
-            u1.NAME AS clientManager,
-            cc.NAME AS clientName,
-            cc1.NAME AS clientSubName,
-            d.NAME AS evaluateDepartmentName,
-            (
-                SELECT
-                    GROUP_CONCAT( NAME )
-                FROM
-                    department
-                WHERE
-                        id IN (
-                        SELECT
-                            department_id
-                        FROM
-                            post
-                        WHERE
-                            id IN ( SELECT post_id FROM user_post WHERE user_id = m.client_manager_id ))) AS marketDepartmentName,
-        invoice.name AS invoiceUser,
-        invoice.real_make_date AS invoiceDate,
-        invoice.tax_no AS invoiceNo,
+        fc.id,
+        fc.claim_amount,
+        m.order_id,
+        mp.report_no,
+        fc.claim_datetime AS claimDate,
+        mp.delivery_date AS deliveryDate,
+        IF
+        ( fc.claim_datetime > mp.delivery_date, fc.claim_datetime, mp.delivery_date ) AS settleDate,
+        mp.NAME,
+        m.bailor,
+        mp.evaluate_amount,
+        u.NAME AS principal,
+        u1.NAME AS clientManager,
+        cc.NAME AS clientName,
+        cc1.NAME AS clientSubName,
+        d.NAME AS evaluateDepartmentName,
+        (
+        SELECT
+        GROUP_CONCAT( NAME )
+        FROM
+        department
+        WHERE
+        id IN (
+        SELECT
+        department_id
+        FROM
+        post
+        WHERE
+        id IN ( SELECT post_id FROM user_post WHERE user_id = m.client_manager_id ))) AS marketDepartmentName,
         frf.pay_datetime
         FROM
-            (
-                SELECT
-                    id,
-                    claim_amount,
-                    order_fund_id,
-                    production_fund_id,
-                    claim_datetime,
-                    real_fund_id
-                FROM
-                    finance_claim
-                WHERE
-                    deleted = 0
-                  AND production_fund_id IS NOT NULL
-                  AND claim_datetime  &gt;= #{settleVO.startDate}
-                  AND claim_datetime &lt;= #{settleVO.endDate} UNION ALL
-            SELECT id, allot_amount AS claim_amount, order_fund_id, production_fund_id, created AS claim_datetime ,real_fund_id FROM order_fund_allot WHERE deleted = 0
-                AND created  &gt;= #{settleVO.startDate}
-                AND created &lt;= #{settleVO.endDate}
-            ) fc  inner join (
-        select id,pay_datetime from finance_real_fund
-        where deleted = 0
+        (
+        SELECT
+        id,
+        claim_amount,
+        order_fund_id,
+        production_fund_id,
+        claim_datetime,
+        real_fund_id
+        FROM
+        finance_claim
+        WHERE
+        deleted = 0
+        AND production_fund_id IS NOT NULL
+        ) fc
+        INNER JOIN ( SELECT id, pay_datetime FROM finance_real_fund WHERE deleted = 0
         <if test="settleVO!=null and settleVO.payStartDate!=null and settleVO.payStartDate!='' ">
             AND pay_datetime &gt;= #{settleVO.payStartDate}
         </if>
         <if test="settleVO!=null and settleVO.payEndDate!=null and settleVO.payEndDate!='' ">
             AND pay_datetime &lt;= #{settleVO.payEndDate}
         </if>
-        ) frf on frf.id = fc.real_fund_id
-                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-                INNER JOIN ( SELECT id, major_id, NAME, report_no, production, evaluate_amount, delivery_date FROM major_production WHERE deleted = 0 AND delivery_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
-                LEFT JOIN major m ON m.id = mp.major_id
-                LEFT JOIN user u ON u.id = m.principal_id
-                LEFT JOIN user u1 ON u1.id = m.client_manager_id
-                LEFT JOIN customer_company cc ON cc.id = m.clientele_id
-                LEFT JOIN customer_company cc1 ON cc1.id = m.clientele_sub_id
-                LEFT JOIN department d ON d.id = m.department_id
-                LEFT JOIN (
-                SELECT real_make_date, name, tax_no, order_fund_id, production_fund_id
-                FROM finance_invoice, user
-                WHERE maker_id = user.id
-                AND finance_invoice.deleted = 0
-                AND state = '已开票'
-                ) AS invoice ON IF(invoice.production_fund_id IS NOT NULL ,invoice.order_fund_id = pf.order_fund_id AND invoice.production_fund_id = pf.id,invoice.order_fund_id = pf.order_fund_id)
+        ) frf ON frf.id = fc.real_fund_id
+        INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
+        INNER JOIN (
+        SELECT
+        id,
+        major_id,
+        NAME,
+        report_no,
+        production,
+        evaluate_amount,
+        delivery_date,
+        fund.real_amount
+        FROM
+        major_production mpr
+        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
+        WHERE
+        fund.real_amount IS NOT NULL
+        AND mpr.delivery_date IS NOT NULL
+        ) mp ON mp.report_no = pf.production_no
+        LEFT JOIN major m ON m.id = mp.major_id
+        LEFT JOIN user u ON u.id = m.principal_id
+        LEFT JOIN user u1 ON u1.id = m.client_manager_id
+        LEFT JOIN customer_company cc ON cc.id = m.clientele_id
+        LEFT JOIN customer_company cc1 ON cc1.id = m.clientele_sub_id
+        LEFT JOIN department d ON d.id = m.department_id
         <where>
-            <if test="settleVO!=null and settleVO.orderId!=null and settleVO.orderId!='' ">
-                and m.order_id = #{settleVO.orderId}
-            </if>
-            <if test="settleVO!=null and settleVO.reportNo!=null and settleVO.reportNo!='' ">
-                and mp.report_no like concat ('%',#{settleVO.reportNo},'%')
+            <if test="keyword!=null and keyword!='' ">
+                and (
+                mp.report_no like concat ('%',#{keyword},'%')
+                or fc.claim_amount =#{keyword}
+                or m.order_id like concat('%',#{keyword},'%')
+                or u.name like concat('%',#{keyword},'%')
+                or u1.name like concat('%',#{keyword},'%')
+                )
             </if>
-            <if test="settleVO!=null and settleVO.principal!=null and settleVO.principal!='' ">
-                and u.name like concat ('%',#{settleVO.principal},'%')
+            <if test="settleVO!=null and settleVO.startDate!=null and settleVO.startDate!='' ">
+                AND  (select IF
+                ( fc.claim_datetime > mp.delivery_date, fc.claim_datetime, mp.delivery_date )) &gt;= #{settleVO.startDate}
             </if>
-            <if test="settleVO!=null and settleVO.clientManager!=null and settleVO.clientManager!='' ">
-                and u1.name like concat ('%',#{settleVO.clientManager},'%')
+            <if test="settleVO!=null and settleVO.endDate!=null and settleVO.endDate!='' ">
+                AND  (select IF
+                ( fc.claim_datetime > mp.delivery_date, fc.claim_datetime, mp.delivery_date )) &lt;= #{settleVO.endDate}
             </if>
         </where>
             order by fc.claim_datetime ASC
@@ -583,25 +596,30 @@
                   AND production_fund_id IS NOT NULL
                   AND claim_datetime &gt;= #{vo.startDate}
                   AND claim_datetime  &lt;= #{vo.endDate}
-                UNION ALL
-                SELECT
-                    allot_amount AS claim_amount,
-                    order_fund_id,
-                    production_fund_id,
-                    created AS claim_datetime
-                FROM
-                    order_fund_allot
-                WHERE
-                    deleted = 0
-                  AND created  &gt;= #{vo.startDate}
-                  AND created &lt;= #{vo.endDate}
+
             ) fc
                 INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-                INNER JOIN ( SELECT id, major_id, NAME, report_no, production, save_file_date, created FROM major_production WHERE deleted = 0 AND save_file_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
+                INNER JOIN (
+        SELECT
+        id,
+        major_id,
+        NAME,
+        report_no,
+        production,
+        evaluate_amount,
+        save_file_date,
+        fund.real_amount
+        FROM
+        major_production mpr
+        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
+        WHERE
+        fund.real_amount IS NOT NULL
+        AND mpr.save_file_date IS NOT NULL
+        ) mp ON mp.report_no = pf.production_no
                 LEFT JOIN major m ON m.id = mp.major_id
                 INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_EVALUATE' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
                         cd.business_id = m.id
-                    AND ( cd.production_id IS NULL OR cd.production_id = mp.id ))
+                    AND  cd.production_id = mp.id )
                 LEFT JOIN business_commission_rate bcr ON bcr.id = cd.commission_rate_id
                 LEFT JOIN dict_data dd ON dd.id = bcr.business_cate_id
                 LEFT JOIN ( SELECT major_id, major_production_id, user_id, ratio FROM major_production_allot WHERE deleted = 0 AND user_type = 'EVALUATE'
@@ -656,25 +674,30 @@
                   AND production_fund_id IS NOT NULL
                   AND claim_datetime &gt;= #{vo.startDate}
                   AND claim_datetime  &lt;= #{vo.endDate}
-                UNION ALL
+            ) fc
+                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
+                INNER JOIN (
                 SELECT
-                    allot_amount AS claim_amount,
-                    order_fund_id,
-                    production_fund_id,
-                    created AS claim_datetime
+                    id,
+                    major_id,
+                    NAME,
+                    report_no,
+                    production,
+                    evaluate_amount,
+                    save_file_date,
+                    fund.real_amount,
+                    created
                 FROM
-                    order_fund_allot
+                    major_production mpr
+                        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
                 WHERE
-                    deleted = 0
-                  AND created  &gt;= #{vo.startDate}
-                  AND created &lt;= #{vo.endDate}
-            ) fc
-                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-                INNER JOIN ( SELECT id, major_id, NAME, report_no, production, save_file_date, created FROM major_production WHERE deleted = 0 AND save_file_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
+                    fund.real_amount IS NOT NULL
+                  AND mpr.save_file_date IS NOT NULL
+            ) mp ON mp.report_no = pf.production_no
                 LEFT JOIN major m ON m.id = mp.major_id
                 INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_EVALUATE' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
                         cd.business_id = m.id
-                    AND ( cd.production_id IS NULL OR cd.production_id = mp.id ))
+                    AND  cd.production_id = mp.id )
                 LEFT JOIN business_commission_rate bcr ON bcr.id = cd.commission_rate_id
                 LEFT JOIN dict_data dd ON dd.id = bcr.business_cate_id
                 LEFT JOIN ( SELECT major_id, major_production_id, user_id, ratio FROM major_production_allot WHERE deleted = 0 AND user_type = 'EVALUATE' ) mpa ON ( mpa.major_id = m.id AND mpa.major_production_id = mp.id)
@@ -704,25 +727,29 @@
                   AND production_fund_id IS NOT NULL
                   AND claim_datetime &gt;= #{vo.startDate}
                   AND claim_datetime  &lt;= #{vo.endDate}
-                UNION ALL
+            ) fc
+                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
+                INNER JOIN (
                 SELECT
-                    allot_amount AS claim_amount,
-                    order_fund_id,
-                    production_fund_id,
-                    created AS claim_datetime
+                    id,
+                    major_id,
+                    NAME,
+                    report_no,
+                    production,
+                    evaluate_amount,
+                    save_file_date,
+                    fund.real_amount
                 FROM
-                    order_fund_allot
+                    major_production mpr
+                        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
                 WHERE
-                    deleted = 0
-                  AND created  &gt;= #{vo.startDate}
-                  AND created &lt;= #{vo.endDate}
-            ) fc
-                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-                INNER JOIN ( SELECT id, major_id, NAME, report_no, production, save_file_date, created FROM major_production WHERE deleted = 0 AND save_file_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
+                    fund.real_amount IS NOT NULL
+                  AND mpr.save_file_date IS NOT NULL
+            ) mp ON mp.report_no = pf.production_no
                 LEFT JOIN major m ON m.id = mp.major_id
                 INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_EVALUATE' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
                         cd.business_id = m.id
-                    AND ( cd.production_id IS NULL OR cd.production_id = mp.id ))
+                    AND  cd.production_id = mp.id )
                 LEFT JOIN business_commission_rate bcr ON bcr.id = cd.commission_rate_id
                 LEFT JOIN dict_data dd ON dd.id = bcr.business_cate_id
                 LEFT JOIN ( SELECT major_id, major_production_id, user_id, ratio FROM major_production_allot WHERE deleted = 0 AND user_type = 'EVALUATE'
@@ -763,25 +790,30 @@
                   AND production_fund_id IS NOT NULL
                   AND claim_datetime &gt;= #{vo.startDate}
                   AND claim_datetime  &lt;= #{vo.endDate}
-                UNION ALL
-                SELECT
-                    allot_amount AS claim_amount,
-                    order_fund_id,
-                    production_fund_id,
-                    created AS claim_datetime
-                FROM
-                    order_fund_allot
-                WHERE
-                    deleted = 0
-                  AND created  &gt;= #{vo.startDate}
-                  AND created &lt;= #{vo.endDate}
             ) fc
                 INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-                INNER JOIN ( SELECT id, major_id, NAME, report_no, production, save_file_date, created FROM major_production WHERE deleted = 0 AND save_file_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
+                INNER JOIN (
+        SELECT
+        id,
+        major_id,
+        NAME,
+        report_no,
+        production,
+        evaluate_amount,
+        save_file_date,
+        fund.real_amount,
+        created
+        FROM
+        major_production mpr
+        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
+        WHERE
+        fund.real_amount IS NOT NULL
+        AND mpr.save_file_date IS NOT NULL
+        ) mp ON mp.report_no = pf.production_no
                 LEFT JOIN major m ON m.id = mp.major_id
                 INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_EVALUATE' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
                         cd.business_id = m.id
-                    AND ( cd.production_id IS NULL OR cd.production_id = mp.id ))
+                    AND cd.production_id = mp.id )
                 LEFT JOIN business_commission_rate bcr ON bcr.id = cd.commission_rate_id
                 LEFT JOIN dict_data dd ON dd.id = bcr.business_cate_id
                 LEFT JOIN ( SELECT major_id, major_production_id, user_id, ratio FROM major_production_allot WHERE deleted = 0 AND user_type = 'EVALUATE' ) mpa ON ( mpa.major_id = m.id AND mpa.major_production_id = mp.id)
@@ -810,17 +842,29 @@
         AND production_fund_id IS NOT NULL
         AND claim_datetime &gt;= #{vo.startDate}
         AND claim_datetime  &lt;= #{vo.endDate}
-
-        UNION ALL SELECT allot_amount AS claim_amount, order_fund_id, production_fund_id, created AS claim_datetime FROM order_fund_allot WHERE deleted = 0
-        AND created  &gt;= #{vo.startDate}
-        AND created &lt;= #{vo.endDate}
         ) fc
         INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-        INNER JOIN ( SELECT id, major_id, NAME, report_no, production, save_file_date, created FROM major_production WHERE deleted = 0 AND delivery_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
+        INNER JOIN (
+        SELECT
+        id,
+        major_id,
+        NAME,
+        report_no,
+        production,
+        evaluate_amount,
+        delivery_date,
+        fund.real_amount
+        FROM
+        major_production mpr
+        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
+        WHERE
+        fund.real_amount IS NOT NULL
+        AND mpr.delivery_date IS NOT NULL
+        ) mp ON mp.report_no = pf.production_no
         LEFT JOIN major m ON m.id = mp.major_id
         INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_MARKET' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
         cd.business_id = m.id
-        AND ( cd.production_id IS NULL OR cd.production_id = mp.id ))
+        AND cd.production_id = mp.id )
         LEFT JOIN business_commission_rate bcr ON bcr.id = cd.commission_rate_id
         LEFT JOIN dict_data dd ON dd.id = bcr.business_cate_id
         LEFT JOIN ( SELECT major_id, major_production_id,declare_id, user_id, ratio FROM major_production_allot WHERE deleted = 0 AND user_type = 'MARKET'
@@ -850,7 +894,7 @@
             fc.claim_amount as realAmount,
             mp.report_no,
             IF
-                ( fc.claim_datetime > mp.save_file_date, fc.claim_datetime, mp.save_file_date ) AS settleDate,
+                ( fc.claim_datetime > mp.delivery_date, fc.claim_datetime, mp.delivery_date ) AS settleDate,
             mp.NAME,
             mp.created,
             dd.NAME AS businessCate,
@@ -874,25 +918,31 @@
                   AND production_fund_id IS NOT NULL
                   AND claim_datetime &gt;= #{vo.startDate}
                   AND claim_datetime  &lt;= #{vo.endDate}
-                UNION ALL
+            ) fc
+                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
+                INNER JOIN (
                 SELECT
-                    allot_amount AS claim_amount,
-                    order_fund_id,
-                    production_fund_id,
-                    created AS claim_datetime
+                    id,
+                    major_id,
+                    NAME,
+                    report_no,
+                    production,
+                    evaluate_amount,
+                    delivery_date,
+                    fund.real_amount,
+                    created
                 FROM
-                    order_fund_allot
+                    major_production mpr
+                        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
                 WHERE
-                    deleted = 0
-                  AND created  &gt;= #{vo.startDate}
-                  AND created &lt;= #{vo.endDate}
-            ) fc
-                INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-                INNER JOIN ( SELECT id, major_id, NAME, report_no, production, save_file_date, created FROM major_production WHERE deleted = 0 AND delivery_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
+                    fund.real_amount IS NOT NULL
+                  AND mpr.delivery_date IS NOT NULL
+
+            ) mp ON mp.report_no = pf.production_no
                 LEFT JOIN major m ON m.id = mp.major_id
                 INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_MARKET' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
                         cd.business_id = m.id
-                    AND ( cd.production_id IS NULL OR cd.production_id = mp.id ))
+                    AND  cd.production_id = mp.id )
                 LEFT JOIN business_commission_rate bcr ON bcr.id = cd.commission_rate_id
                 LEFT JOIN dict_data dd ON dd.id = bcr.business_cate_id
                 LEFT JOIN ( SELECT major_id, major_production_id, user_id, ratio,declare_id FROM major_production_allot WHERE deleted = 0 AND user_type = 'MARKET' ) mpa  ON ( mpa.major_id = m.id AND cd.id = mpa.declare_id AND (mpa.major_production_id is null or mpa.major_production_id = mp.id ))
@@ -922,18 +972,29 @@
                   AND production_fund_id IS NOT NULL
                   AND claim_datetime &gt;= #{vo.startDate}
                   AND claim_datetime  &lt;= #{vo.endDate}
-
-                UNION ALL
-                SELECT allot_amount AS claim_amount, order_fund_id, production_fund_id, created AS claim_datetime FROM order_fund_allot WHERE deleted = 0
-                AND created  &gt;= #{vo.startDate}
-                AND created &lt;= #{vo.endDate}
             ) fc
                 INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-                INNER JOIN ( SELECT id, major_id, NAME, report_no, production, save_file_date, created FROM major_production WHERE deleted = 0 AND delivery_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
+                INNER JOIN (
+                SELECT
+                    id,
+                    major_id,
+                    NAME,
+                    report_no,
+                    production,
+                    evaluate_amount,
+                    delivery_date,
+                    fund.real_amount
+                FROM
+                    major_production mpr
+                        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
+                WHERE
+                    fund.real_amount IS NOT NULL
+                  AND mpr.delivery_date IS NOT NULL
+            ) mp ON mp.report_no = pf.production_no
                 LEFT JOIN major m ON m.id = mp.major_id
                 INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_MARKET' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
                         cd.business_id = m.id
-                    AND ( cd.production_id IS NULL OR cd.production_id = mp.id ))
+                    AND  cd.production_id = mp.id )
                 LEFT JOIN business_commission_rate bcr ON bcr.id = cd.commission_rate_id
                 LEFT JOIN dict_data dd ON dd.id = bcr.business_cate_id
                 LEFT JOIN ( SELECT major_id, major_production_id,declare_id, user_id, ratio FROM major_production_allot WHERE deleted = 0 AND user_type = 'MARKET'
@@ -952,7 +1013,7 @@
         ROUND(fc.claim_amount,2) as realAmount,
         mp.report_no,
         IF
-        ( fc.claim_datetime > mp.save_file_date, fc.claim_datetime, mp.save_file_date ) AS settleDate,
+        ( fc.claim_datetime > mp.delivery_date, fc.claim_datetime, mp.delivery_date ) AS settleDate,
         mp.NAME,
         mp.created,
         dd.NAME AS businessCate,
@@ -976,25 +1037,30 @@
                   AND production_fund_id IS NOT NULL
                   AND claim_datetime &gt;= #{vo.startDate}
                   AND claim_datetime  &lt;= #{vo.endDate}
-                UNION ALL
-                SELECT
-                    allot_amount AS claim_amount,
-                    order_fund_id,
-                    production_fund_id,
-                    created AS claim_datetime
-                FROM
-                    order_fund_allot
-                WHERE
-                    deleted = 0
-                  AND created  &gt;= #{vo.startDate}
-                  AND created &lt;= #{vo.endDate}
             ) fc
                 INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
-                INNER JOIN ( SELECT id, major_id, NAME, report_no, production, save_file_date, created FROM major_production WHERE deleted = 0 AND delivery_date IS NOT NULL ) mp ON mp.report_no = pf.production_no
+                INNER JOIN (
+        SELECT
+        id,
+        major_id,
+        NAME,
+        report_no,
+        production,
+        evaluate_amount,
+        delivery_date,
+        fund.real_amount,
+        created
+        FROM
+        major_production mpr
+        INNER JOIN ( SELECT production_no, real_amount, production_type FROM production_fund WHERE deleted = 0 AND business_type = 'MAJOR_BUSINESS' ) fund ON ( fund.production_no = mpr.report_no AND fund.production_type = mpr.production )
+        WHERE
+        fund.real_amount IS NOT NULL
+        AND mpr.delivery_date IS NOT NULL
+        ) mp ON mp.report_no = pf.production_no
                 LEFT JOIN major m ON m.id = mp.major_id
                 INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_MAJOR_MARKET' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
                         cd.business_id = m.id
-                    AND ( cd.production_id IS NULL OR cd.production_id = mp.id ))
+                    AND cd.production_id = mp.id )
                 LEFT JOIN business_commission_rate bcr ON bcr.id = cd.commission_rate_id
                 LEFT JOIN dict_data dd ON dd.id = bcr.business_cate_id
                 LEFT JOIN ( SELECT major_id, major_production_id, user_id, ratio,declare_id FROM major_production_allot WHERE deleted = 0 AND user_type = 'MARKET' ) mpa  ON ( mpa.major_id = m.id AND cd.id = mpa.declare_id AND (mpa.major_production_id is null or mpa.major_production_id = mp.id ))

+ 11 - 0
domain/src/main/java/com/dayou/dto/history/CommissionRate.java

@@ -0,0 +1,11 @@
+package com.dayou.dto.history;
+
+import lombok.Data;
+
+@Data
+public class CommissionRate {
+
+    private String name;
+
+    private Double rate;
+}

+ 25 - 0
domain/src/main/java/com/dayou/dto/history/HisCommissionDeclare.java

@@ -0,0 +1,25 @@
+package com.dayou.dto.history;
+
+import lombok.Data;
+
+@Data
+public class HisCommissionDeclare {
+
+    private String id;
+
+    private String masterName;
+
+    private String managerName;
+
+    private String reportNO;
+
+    private String masterBusinessType;
+
+    private String masterApproveStatus;
+
+    private String pgApproveStatus;
+
+    private String pgBusinessType;
+
+    private String production;
+}

+ 2 - 0
domain/src/main/java/com/dayou/vo/RealFundPersonalVO.java

@@ -77,4 +77,6 @@ public class RealFundPersonalVO {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date payEndTime;
 
+
+
 }

+ 175 - 0
service/src/main/java/com/dayou/dyoa/DyoaHistoryServiceImpl.java

@@ -12,8 +12,10 @@ import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.common.BaseEntity;
+import com.dayou.common.PullDownModel;
 import com.dayou.dto.history.*;
 import com.dayou.entity.*;
 import com.dayou.enums.MainBusinessEnum;
@@ -90,6 +92,10 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
 
     private static final Map<String,String> FINANCE_INVOICE_COLUM = new HashMap<>();
 
+    private static  Map<String,Long> PG_BUSINESS_TYPE = new HashMap<>();
+
+    private static  Map<String,Long> SC_BUSINESS_TYPE = new HashMap<>();
+
 
 
 
@@ -148,6 +154,9 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
     @Autowired
     private IPersonalTargetService personalTargetService;
 
+    @Autowired
+    private ICommissionDeclareService commissionDeclareService;
+
     static {
 //        MAJOR_ORDER_COLUM.put("id","id");
         MAJOR_ORDER_COLUM.put("name","name");
@@ -1600,15 +1609,155 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
                     }
                     if (productionNo.getArchiveTime()!=null){
                         majorProduction.setSaveFileDate(DateUtils.dateToLocalDate(productionNo.getArchiveTime()));
+                        majorProduction.setIfSaveFile(true);
                     }
                     majorProduction.setStandardAmount(productionNo.getStandardPrice());
                     majorProductionService.save(majorProduction);
                 }
             }
+            else{
+                //更新已同步产品的归档状态、归档时间、送达状态、送达时间
+                boolean flog = false;
+                for (MajorProduction majorProduction :list){
+                    Date archiveTime = productionNo.getArchiveTime();
+                    Date confirmTime = productionNo.getConfirmTime();
+                    if (archiveTime!=null){
+                        flog = true;
+                        majorProduction.setIfSaveFile(true);
+                        majorProduction.setSaveFileDate(DateUtils.dateToLocalDate(archiveTime));
+                    }
+                    if (confirmTime!=null){
+                        flog = true;
+                        majorProduction.setDelivery(true);
+                        majorProduction.setDeliveryDate(DateUtils.dateToLocalDate(confirmTime));
+                    }
+                    if (flog){
+                        majorProductionService.update(new LambdaUpdateWrapper<MajorProduction>()
+                                .eq(BaseEntity::getId,majorProduction.getId())
+                                .set(majorProduction.getIfSaveFile()!=null,MajorProduction::getIfSaveFile,majorProduction.getIfSaveFile())
+                                .set(majorProduction.getSaveFileDate()!=null,MajorProduction::getSaveFileDate,majorProduction.getSaveFileDate())
+                                .set(majorProduction.getDelivery()!=null,MajorProduction::getDelivery,majorProduction.getDelivery())
+                                .set(majorProduction.getDeliveryDate()!=null,MajorProduction::getDeliveryDate,majorProduction.getDeliveryDate()));
+                    }
+
+                }
+            }
         }
         return true;
     }
 
+    @Autowired
+    private IMajorProductionAllotService majorProductionAllotService;
+
+    @Override
+    public Boolean updateCommissionDeclare() {
+        List<HisCommissionDeclare> list = dyoaHistoryMapper.findCommissionDeclareInDyOA();
+        BigDecimal divisor = new BigDecimal("100");
+        for (HisCommissionDeclare hisCommissionDeclare : list){
+            Long pgUserId = getMbsUserId(hisCommissionDeclare.getManagerName());
+            Long scUserId = getMbsUserId(hisCommissionDeclare.getMasterName());
+            Long majorId = dyoaRecordService.getMbsIdByDyOAId(hisCommissionDeclare.getId());
+            Long mpId = null;
+            if (StrUtil.isNotBlank(hisCommissionDeclare.getReportNO())){
+                List<MajorProduction> mps = majorProductionService.list(new LambdaQueryWrapper<MajorProduction>()
+                        .select(BaseEntity::getId)
+                        .eq(MajorProduction::getReportNo, hisCommissionDeclare.getReportNO()));
+                if  (CollectionUtils.isNotEmpty(mps)){
+                    mpId = mps.get(0).getId();
+                }
+            }
+            if (StrUtil.isNotBlank(hisCommissionDeclare.getPgApproveStatus()) &&
+                "通过".equals(hisCommissionDeclare.getPgApproveStatus())){
+                String pgBusinessType = hisCommissionDeclare.getPgBusinessType();
+                Long pgBusinessType1 = findPgBusinessType(pgBusinessType);
+                Long pgcdId = null;
+                CommissionDeclare pgCd = commissionDeclareService.getOne(new LambdaQueryWrapper<CommissionDeclare>()
+                        .eq(CommissionDeclare::getBusinessType, "COMMISSION_DECLARE_MAJOR_EVALUATE")
+                        .eq(CommissionDeclare::getBusinessId, majorId)
+                        .eq(mpId != null, CommissionDeclare::getProductionId, mpId)
+                        .eq(CommissionDeclare::getDeclareUserId, pgUserId)
+                        .eq(CommissionDeclare::getDeclareResult, "审核通过")
+                        .eq(CommissionDeclare::getCommissionRateId, pgBusinessType1));
+                if (pgCd==null ){
+                    CommissionDeclare commissionDeclare = new CommissionDeclare();
+                    commissionDeclare.setBusinessType("COMMISSION_DECLARE_MAJOR_EVALUATE");
+                    commissionDeclare.setBusinessId(majorId);
+                    commissionDeclare.setDeclareResult("审核通过");
+                    commissionDeclare.setDeclareUserId(pgUserId);
+                    commissionDeclare.setCommissionRateId(pgBusinessType1);
+                    commissionDeclare.setProductionId(mpId);
+                    commissionDeclareService.save(commissionDeclare);
+                    pgcdId = commissionDeclare.getId();
+                }else{
+                    pgcdId = pgCd.getId();
+                }
+                //查询评估人员绩效比例
+                List<CommissionRate> rates = dyoaHistoryMapper.findPgRate(hisCommissionDeclare.getId());
+                for (CommissionRate commissionRate : rates){
+                    MajorProductionAllot majorProductionAllot = new MajorProductionAllot();
+                    majorProductionAllot.setMajorProductionId(mpId);
+                    majorProductionAllot.setMajorId(majorId);
+                    majorProductionAllot.setUserId(getMbsUserId(commissionRate.getName()));
+                    majorProductionAllot.setRatio(BigDecimal.valueOf(commissionRate.getRate()).divide(divisor));
+                    majorProductionAllot.setUserType("EVALUATE");
+                    majorProductionAllot.setDeclareId(pgcdId);
+                    List<MajorProductionAllot> allos = majorProductionAllotService.list(new LambdaQueryWrapper<MajorProductionAllot>()
+                            .eq(MajorProductionAllot::getDeclareId, pgcdId).eq(MajorProductionAllot::getUserId,majorProductionAllot.getUserId()));
+                    if (CollectionUtils.isEmpty(allos)){
+                        majorProductionAllotService.save(majorProductionAllot);
+                    }
+
+                }
+
+
+            }
+            if (StrUtil.isNotBlank(hisCommissionDeclare.getMasterApproveStatus()) &&
+                    "通过".equals(hisCommissionDeclare.getMasterApproveStatus())){
+                String scBusinessType = hisCommissionDeclare.getMasterBusinessType();
+                Long scBusinessType1 = findSCBusinessType(scBusinessType);
+                Long sccdId = null;
+                CommissionDeclare pgCd = commissionDeclareService.getOne(new LambdaQueryWrapper<CommissionDeclare>()
+                        .eq(CommissionDeclare::getBusinessType, "COMMISSION_DECLARE_MAJOR_MARKET")
+                        .eq(CommissionDeclare::getBusinessId, majorId)
+                        .eq(mpId != null, CommissionDeclare::getProductionId, mpId)
+                        .eq(CommissionDeclare::getDeclareUserId, scUserId)
+                        .eq(CommissionDeclare::getDeclareResult, "审核通过")
+                        .eq(CommissionDeclare::getCommissionRateId, scBusinessType1));
+                if (pgCd==null){
+                    CommissionDeclare commissionDeclare = new CommissionDeclare();
+                    commissionDeclare.setBusinessType("COMMISSION_DECLARE_MAJOR_MARKET");
+                    commissionDeclare.setBusinessId(majorId);
+                    commissionDeclare.setDeclareResult("审核通过");
+                    commissionDeclare.setDeclareUserId(scUserId);
+                    commissionDeclare.setCommissionRateId(scBusinessType1);
+                    commissionDeclare.setProductionId(mpId);
+                    commissionDeclareService.save(commissionDeclare);
+                    sccdId = commissionDeclare.getId();
+                }else {
+                    sccdId = pgCd.getId();
+                }
+                //查询市场人员绩效比例
+                List<CommissionRate> rates = dyoaHistoryMapper.findScRate(hisCommissionDeclare.getId());
+                for (CommissionRate commissionRate : rates){
+                    MajorProductionAllot majorProductionAllot = new MajorProductionAllot();
+                    majorProductionAllot.setMajorProductionId(mpId);
+                    majorProductionAllot.setMajorId(majorId);
+                    majorProductionAllot.setUserId(getMbsUserId(commissionRate.getName()));
+                    majorProductionAllot.setRatio(BigDecimal.valueOf(commissionRate.getRate()).divide(divisor));
+                    majorProductionAllot.setUserType("MARKET");
+                    majorProductionAllot.setDeclareId(sccdId);
+                    List<MajorProductionAllot> allos = majorProductionAllotService.list(new LambdaQueryWrapper<MajorProductionAllot>()
+                            .eq(MajorProductionAllot::getDeclareId, sccdId).eq(MajorProductionAllot::getUserId,majorProductionAllot.getUserId()));
+                    if (CollectionUtils.isEmpty(allos)){
+                        majorProductionAllotService.save(majorProductionAllot);
+                    }
+                }
+            }
+
+        }
+        return Boolean.TRUE;
+    }
+
     @Override
     public Boolean updateProductionFund() {
         List<OrderFund> orderFunds = orderFundService.getAllOrderFund();
@@ -1640,4 +1789,30 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
         return true;
     }
 
+    @Autowired
+    private IBusinessCommissionRateService businessCommissionRateService;
+
+
+
+    public Long findPgBusinessType(String businessType){
+        Long id = PG_BUSINESS_TYPE.get(businessType);
+        if (id==null){
+            List<PullDownModel> businessCate = businessCommissionRateService.getBusinessCate("MAJOR_BUSINESS", "EVALUATOR");
+            PG_BUSINESS_TYPE = businessCate.stream().collect(Collectors.toMap(PullDownModel::getName, PullDownModel::getId));
+            id = PG_BUSINESS_TYPE.get(businessType);
+        }
+        return id;
+    }
+
+    public Long findSCBusinessType(String businessType){
+        Long id = SC_BUSINESS_TYPE.get(businessType);
+        if (id==null){
+            List<PullDownModel> businessCate = businessCommissionRateService.getBusinessCate("MAJOR_BUSINESS", "MARKETER");
+            SC_BUSINESS_TYPE = businessCate.stream().collect(Collectors.toMap(PullDownModel::getName, PullDownModel::getId));
+            id = SC_BUSINESS_TYPE.get(businessType);
+        }
+        return id;
+    }
+
+
 }

+ 2 - 0
service/src/main/java/com/dayou/dyoa/IDyoaHistoryService.java

@@ -41,4 +41,6 @@ public interface IDyoaHistoryService {
     Boolean updateClaimProductionId();
 
     Boolean updateMajorProduction();
+
+    Boolean updateCommissionDeclare();
 }

+ 7 - 0
service/src/main/java/com/dayou/dyoa/task/FetchDyoaDataSchedule.java

@@ -78,4 +78,11 @@ public class FetchDyoaDataSchedule {
         log.info("更新实收款认领记录的产品收款id");
     }
 
+    //每天凌晨06:55触发
+    @Scheduled(cron = "0 55 6 * * ?")
+    public void updateCommissionDeclare(){
+        dyoaHistoryService.updateCommissionDeclare();
+        log.info("更新大中型提成申报完成");
+    }
+
 }

+ 3 - 3
service/src/main/java/com/dayou/processor/AppBootProcessor.java

@@ -82,9 +82,9 @@ public class AppBootProcessor implements BeanPostProcessor, CommandLineRunner {
         log.info("【initialize admin begin...】");
         initializeAdmin();
         loadBrokerageData();
-        AsyncManager.me().execute(()->{
-            luceneSearchService.initializeIndex();
-        });
+//        AsyncManager.me().execute(()->{
+//            luceneSearchService.initializeIndex();
+//        });
 
     }
 

+ 2 - 0
service/src/main/java/com/dayou/service/IDictDataService.java

@@ -41,4 +41,6 @@ public interface IDictDataService extends IService<DictData> {
         List<DictData> byCode(String code);
 
         DictData findByDataTypeAndRemark(String dataType, String remark);
+
+    List<DictData> findByDataTypeByCode(String businessCate);
 }

+ 1 - 0
service/src/main/java/com/dayou/service/IDyoaRecordService.java

@@ -41,5 +41,6 @@ public interface IDyoaRecordService extends IService<DyoaRecord> {
     Date getMaxFinanceInvoiceCreatedTime();
 
 
+    Long getMbsIdByDyOAId(String id);
 }
 

+ 1 - 1
service/src/main/java/com/dayou/service/IPersonalProductionService.java

@@ -32,7 +32,7 @@ public interface IPersonalProductionService extends IService<PersonalProduction>
 
         Boolean delete(Long id);
 
-    Boolean genFile(Long personalId, Integer tag) throws JsonProcessingException;
+    Boolean genFile(Long personalId, Integer tag);
 
     Boolean upload(String filePath, MultipartFile file,Long targetId, Integer tag);
 

+ 2 - 0
service/src/main/java/com/dayou/service/impl/BusinessCommissionRateServiceImpl.java

@@ -1,5 +1,6 @@
 package com.dayou.service.impl;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.dayou.common.PullDownModel;
 import com.dayou.entity.BusinessCommissionRate;
 import com.dayou.mapper.BusinessCommissionRateMapper;
@@ -34,6 +35,7 @@ import com.dayou.enums.BatchTaskTypeEnum;
  * @author wucl
  * @since 2024-05-11
  */
+@DS("mbs")
 @Service
 public class BusinessCommissionRateServiceImpl extends ServiceImpl<BusinessCommissionRateMapper, BusinessCommissionRate> implements IBusinessCommissionRateService {
 

+ 2 - 0
service/src/main/java/com/dayou/service/impl/CommissionDeclareServiceImpl.java

@@ -1,6 +1,7 @@
 package com.dayou.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.dayou.common.BaseEntity;
@@ -45,6 +46,7 @@ import static com.dayou.message.MessageTypeEnum.MAJOR_DECLARE_REMIND;
  * @author wucl
  * @since 2024-05-15
  */
+@DS("mbs")
 @Service
 public class CommissionDeclareServiceImpl extends ServiceImpl<CommissionDeclareMapper, CommissionDeclare> implements ICommissionDeclareService {
 

+ 7 - 0
service/src/main/java/com/dayou/service/impl/DictDataServiceImpl.java

@@ -25,6 +25,8 @@ import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Collections;
 import java.util.List;
 import java.util.ArrayList;
 import org.springframework.transaction.annotation.Transactional;
@@ -156,4 +158,9 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
         return dictDataMapper.findByDataTypeAndName(dataType,remark);
     }
 
+    @Override
+    public List<DictData> findByDataTypeByCode(String businessCate) {
+        return dictDataMapper.findByDataTypeByCode(businessCate);
+    }
+
 }

+ 4 - 0
service/src/main/java/com/dayou/service/impl/DyoaRecordServiceImpl.java

@@ -93,6 +93,10 @@ public class DyoaRecordServiceImpl extends ServiceImpl<DyoaRecordMapper, DyoaRec
         return dyoaRecordMapper.getMaxFinanceInvoiceCreatedTime();
     }
 
+    @Override
+    public Long getMbsIdByDyOAId(String id) {
+        return dyoaRecordMapper.getMbsIdByDyOAId(id);
+    }
 
 
 }

+ 2 - 0
service/src/main/java/com/dayou/service/impl/MajorProductionAllotServiceImpl.java

@@ -1,6 +1,7 @@
 package com.dayou.service.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.dayou.dto.UserShareRate;
 import com.dayou.entity.Major;
@@ -40,6 +41,7 @@ import com.dayou.enums.BatchTaskTypeEnum;
  * @author wucl
  * @since 2024-02-19
  */
+@DS("mbs")
 @Service
 public class MajorProductionAllotServiceImpl extends ServiceImpl<MajorProductionAllotMapper, MajorProductionAllot> implements IMajorProductionAllotService {
 

+ 2 - 15
service/src/main/java/com/dayou/service/impl/PersonalProductionServiceImpl.java

@@ -22,10 +22,6 @@ import com.dayou.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.utils.*;
 import com.dayou.vo.*;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -123,7 +119,7 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
     }
 
     @Override
-    public Boolean genFile(Long personalId, Integer tag) throws JsonProcessingException {
+    public Boolean genFile(Long personalId, Integer tag)  {
         //获取提供的证件信息
         Personal personal = personalService.getOne(new LambdaQueryWrapper<Personal>().select(Personal::getCredentials).eq(BaseEntity::getId, personalId).eq(BaseEntity::getDeleted, Boolean.FALSE));
         String orderId = personalService.getOne(new LambdaQueryWrapper<Personal>().eq(BaseEntity::getId, personalId).select(Personal::getOrderId).eq(BaseEntity::getDeleted, Boolean.FALSE)).getOrderId();
@@ -133,9 +129,6 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
         Map<String,Object> textMap = new HashMap();
 
         PersonalSellingAbilityVO sell = JSON.parseObject(target.getSellingAbility(), PersonalSellingAbilityVO.class);
-        ObjectMapper mapper = new ObjectMapper();
-        JsonNode rootNode = mapper.readTree(target.getLandCertificate());
-        sell.setLimitDate(rootNode.path("limitDateD").asText());
         PersonalBackgroundInfo bg = JSON.parseObject(target.getBackgroundInfo(), PersonalBackgroundInfo.class);
         PersonalEntityInfoVO en = JSON.parseObject(target.getEntityInfo(), PersonalEntityInfoVO.class);
         Field[] sellFields = sell.getClass().getDeclaredFields();
@@ -190,9 +183,7 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
             Map<String,Object> textMap = new HashMap();
 
             PersonalSellingAbilityVO sell = JSON.parseObject(target.getSellingAbility(), PersonalSellingAbilityVO.class);
-            ObjectMapper mapper = new ObjectMapper();
-            JsonNode rootNode = mapper.readTree(target.getLandCertificate());
-            sell.setLimitDate(rootNode.path("limitDateD").asText());
+
             PersonalBackgroundInfo bg = JSON.parseObject(target.getBackgroundInfo(), PersonalBackgroundInfo.class);
             PersonalEntityInfoVO en = JSON.parseObject(target.getEntityInfo(), PersonalEntityInfoVO.class);
             Field[] sellFields = sell.getClass().getDeclaredFields();
@@ -227,10 +218,6 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
             return Boolean.TRUE;
         } catch (SecurityException e) {
             throw new RuntimeException(e);
-        } catch (JsonMappingException e) {
-            throw new RuntimeException(e);
-        } catch (JsonProcessingException e) {
-            throw new RuntimeException(e);
         }
     }