Kaynağa Gözat

客户收款

姜永辉 1 yıl önce
ebeveyn
işleme
64c5cab4f7

+ 11 - 0
src/main/java/com/dk/mdm/controller/mac/ReceiptController.java

@@ -38,6 +38,17 @@ public class ReceiptController {
     }
 
     /**
+     * @desc : 条件查询--客户详情的收款列表
+     * @author : 姜永辉
+     * @date : 2023/1/9 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"list_by_cus"})
+    public ResponseResultVO<PageList<RecPayResponse>> selectByCondCus(@RequestBody RecPayQuery recPayQuery) {
+        return receiptService.selectByCondCus(recPayQuery);
+    }
+
+    /**
      * @desc :查询收款明细(货物、收款、附件)
      * @author : 付斌
      * @date : 2024-02-28 13:24

+ 14 - 0
src/main/java/com/dk/mdm/mapper/mac/RecPayMapper.java

@@ -69,5 +69,19 @@ public interface RecPayMapper extends BaseMapper<RecPay> {
      * @date : 2024-04-28 9:10
      */
     int deleteById(@Param("id") String id);
+
+    /**
+     * @desc : 根据条件进行查询-客户详情的收款列表
+     * @author : 姜永辉
+     * @date : 2024-02-28 10:18
+     */
+    List<RecPayResponse> selectByCondCus(RecPayQuery recPayQuery);
+
+    /**
+     * @desc : 根据条件进行查询(数量)-客户详情的收款列表
+     * @author : 付斌
+     * @date : 2024-02-28 10:19
+     */
+    Long countByCondCus(RecPayQuery recPayQuery);
 }
 

+ 89 - 4
src/main/java/com/dk/mdm/mapper/mac/RecPayMapper.xml

@@ -246,8 +246,7 @@
                t.flg_valid,
                t.cp_id,
                 tma.receivable_residue,
-                tma.receipt_residue,
-                 concat (tmma.mac_name ) AS "macNames"
+                tma.receipt_residue
         from dkic_b.t_mac_rec_pay as t
                  left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
                  left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.rp_type
@@ -255,8 +254,6 @@
                  left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
                  left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
                   LEFT JOIN  dkic_b.t_mac_account tma  on tma.object_id = t.object_id and tma.object_type in ('对象类型-客户')
-                 left  join   dkic_b.t_mac_rec_pay_item  rpi  on  rpi.rp_id = t.rp_id
-                 left  join   dkic_b.t_mst_money_account tmma  on  tmma.mac_id = rpi.mac_id
         where t.rp_type in ('收付款类型-收款', '收付款类型-退收款')
         <include refid="Condition"/>
 
@@ -297,6 +294,94 @@
         </if>
     </select>
 
+    <!-- 查询表t_mac_rec_pay,(条件查询+分页)列表 -->
+    <select id="selectByCondCus" resultMap="BaseResultMapResponse">
+        select t.rp_id,
+        t.rp_no,
+        t.rp_type,
+        sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "rpTypeName",
+        t.object_id,
+        tmc.cus_code         as "cusCode",
+        tmc.cus_name         as "cusName",
+        tmc.cus_phone        as "cusPhone",
+        tmc.address_full     as "addressFull",
+        t.org_id,
+        tmo.org_name         as "orgName",
+        t.staff_id,
+        tms.staff_name       as "staffName",
+        t.sum_amt_rec,
+        t.sum_amt_pay,
+        t.sum_should_handle,
+        t.sum_use_receipt_residue,
+        t.sum_use_payment_residue,
+        t.sum_amt_receivable_handle,
+        t.sum_amt_payable_handle,
+        t.sum_waive_amt,
+        t.acc_date,
+        t.remarks,
+        t.annex_paths,
+        t.biznis_type,
+        t.biznis_id,
+        t.biznis_no,
+        t.flg_order_handle,
+        t.flg_lock,
+        t.make_staff,
+        makestaff.staff_name as "makeStaffName",
+        t.make_time,
+        t.flg_valid,
+        t.cp_id,
+        tma.receivable_residue,
+        tma.receipt_residue,
+        concat (tmma.mac_name ) AS "macNames"
+        from dkic_b.t_mac_rec_pay as t
+        left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
+        left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.rp_type
+        left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
+        left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
+        left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
+        LEFT JOIN  dkic_b.t_mac_account tma  on tma.object_id = t.object_id and tma.object_type in ('对象类型-客户')
+        left  join   dkic_b.t_mac_rec_pay_item  rpi  on  rpi.rp_id = t.rp_id
+        left  join   dkic_b.t_mst_money_account tmma  on  tmma.mac_id = rpi.mac_id
+        where t.rp_type in ('收付款类型-收款', '收付款类型-退收款')
+        <include refid="Condition"/>
+
+        <if test="searchText !=null and searchText != ''">
+            AND (
+            t.rp_no   LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmc.cus_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmc.cus_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmo.org_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tms.staff_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            )
+        </if>
+        order by t.op_create_time desc
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表t_mac_rec_pay,(条件查询)个数 -->
+    <select id="countByCondCus" resultType="Long">
+        SELECT count(1)
+        from dkic_b.t_mac_rec_pay as t
+        left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
+        left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.rp_type
+        left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
+        left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
+        left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
+        where t.rp_type in ('收付款类型-收款', '收付款类型-退收款')
+        <include refid="Condition"/>
+        <if test="searchText !=null and searchText != ''">
+            AND (
+            t.rp_no   LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmc.cus_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmc.cus_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmo.org_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tms.staff_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            )
+        </if>
+    </select>
+
     <!-- 根据主键查询表t_mac_rec_pay的一行数据 -->
     <select id="selectById" resultMap="BaseResultMapResponse">
         select t.rp_id,

+ 11 - 0
src/main/java/com/dk/mdm/service/mac/ReceiptService.java

@@ -133,6 +133,17 @@ public class ReceiptService extends BaseService<RecPay> {
     }
 
     /**
+     * @desc : 条件查询-客户详情的收款列表
+     * @author : 姜永辉
+     * @date : 2023/1/9 10:40
+     */
+    @Pagination
+    public ResponseResultVO<PageList<RecPayResponse>> selectByCondCus(RecPayQuery recPayQuery) {
+        return super.mergeListWithCount(recPayQuery, recPayMapper.selectByCondCus(recPayQuery),
+                recPayMapper.countByCondCus(recPayQuery));
+    }
+
+    /**
      * @desc : 查询收款明细
      * @author : 付斌
      * @date : 2024-02-28 13:25