Przeglądaj źródła

供应商付款退款查询

于继渤 1 rok temu
rodzic
commit
7e1edacd7f

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

@@ -155,4 +155,16 @@ public class ReceiptController {
     public ResponseResultVO<?> getReceivableReceiptForUpdate(@PathVariable String id) {
     public ResponseResultVO<?> getReceivableReceiptForUpdate(@PathVariable String id) {
         return receiptService.getReceivableReceiptForUpdate(id);
         return receiptService.getReceivableReceiptForUpdate(id);
     }
     }
+
+
+    /**
+     * @desc : 供应商收退款查询
+     * @author : 于继渤
+     * @date : 2024/7/5 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"get_rp_sup_list"})
+    public ResponseResultVO<PageList<RecPayResponse>> getRpSupList(@RequestBody RecPayQuery recPayQuery) {
+        return receiptService.getRpSupList(recPayQuery);
+    }
 }
 }

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

@@ -83,5 +83,19 @@ public interface RecPayMapper extends BaseMapper<RecPay> {
      * @date : 2024-02-28 10:19
      * @date : 2024-02-28 10:19
      */
      */
     Long countByCondCus(RecPayQuery recPayQuery);
     Long countByCondCus(RecPayQuery recPayQuery);
+
+    /**
+     * @desc : 根据条件进行查询
+     * @author : 付斌
+     * @date : 2024-02-28 10:18
+     */
+    List<RecPayResponse> getRpSupList(RecPayQuery recPayQuery);
+
+    /**
+     * @desc : 根据条件进行查询(数量)
+     * @author : 付斌
+     * @date : 2024-02-28 10:19
+     */
+    Long getRpSupListCount(RecPayQuery recPayQuery);
 }
 }
 
 

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

@@ -72,6 +72,15 @@
             <result column="payment_residue" property="paymentResidue"/>
             <result column="payment_residue" property="paymentResidue"/>
             <result column="macNames" property="macNames"/>
             <result column="macNames" property="macNames"/>
              <result column="amt_rec" property="amtRec"/>
              <result column="amt_rec" property="amtRec"/>
+
+        <result column="sup_id" property="supId"/>
+        <result column="sup_code" property="supCode"/>
+        <result column="sup_name" property="supName"/>
+        <result column="sup_type" property="supType"/>
+        <result column="contact_name" property="contactName"/>
+        <result column="contact_phone" property="contactPhone"/>
+        <result column="return_address" property="returnAddress"/>
+
     </resultMap>
     </resultMap>
 
 
     <!-- 通用条件列 -->
     <!-- 通用条件列 -->
@@ -202,6 +211,120 @@
         </if>
         </if>
     </sql>
     </sql>
 
 
+
+    <sql id="Condition_sup">
+        <if test="rpNo != null and rpNo != ''">
+            AND t.rp_no LIKE concat('%',my_ex.likequery(#{rpNo}),'%')
+        </if>
+
+        <if test="rpType != null and rpType != ''">
+            AND t.rp_type = #{rpType}
+        </if>
+        <if test="objectId != null and objectId != ''">
+            AND t.object_id = #{objectId}::uuid
+        </if>
+        <if test="orgId != null and orgId != ''">
+            AND t.org_id = #{orgId}::uuid
+        </if>
+        <if test="staffId != null and staffId != ''">
+            AND t.staff_id = #{staffId}::uuid
+        </if>
+        <if test="sumAmtRec != null">
+            AND t.sum_amt_rec = #{sumAmtRec}
+        </if>
+        <if test="sumAmtPay != null">
+            AND t.sum_amt_pay = #{sumAmtPay}
+        </if>
+        <if test="sumShouldHandle != null">
+            AND t.sum_should_handle = #{sumShouldHandle}
+        </if>
+        <if test="sumUseReceiptResidue != null">
+            AND t.sum_use_receipt_residue = #{sumUseReceiptResidue}
+        </if>
+        <if test="sumUsePaymentResidue != null">
+            AND t.sum_use_payment_residue = #{sumUsePaymentResidue}
+        </if>
+        <if test="sumAmtReceivableHandle != null">
+            AND t.sum_amt_receivable_handle = #{sumAmtReceivableHandle}
+        </if>
+        <if test="sumAmtPayableHandle != null">
+            AND t.sum_amt_payable_handle = #{sumAmtPayableHandle}
+        </if>
+        <if test="sumWaiveAmt != null">
+            AND t.sum_waive_amt = #{sumWaiveAmt}
+        </if>
+        <if test="accDate != null">
+            AND t.acc_date = #{accDate}
+        </if>
+        <if test="remarks != null and remarks != ''">
+            AND t.remarks = #{remarks}
+        </if>
+        <if test="annexPaths != null and annexPaths != ''">
+            AND t.annex_paths = #{annexPaths}
+        </if>
+        <if test="biznisType != null and biznisType != ''">
+            AND t.biznis_type = #{biznisType}
+        </if>
+        <if test="biznisId != null and biznisId != ''">
+            AND t.biznis_id = #{biznisId}::uuid
+        </if>
+        <if test="biznisNo != null and biznisNo != ''">
+            AND t.biznis_no = #{biznisNo}
+        </if>
+        <if test="flgOrderHandle != null">
+            AND t.flg_order_handle = #{flgOrderHandle}
+        </if>
+        <if test="flgLock != null">
+            AND t.flg_lock = #{flgLock}
+        </if>
+        <if test="makeStaff != null and makeStaff != ''">
+            AND t.make_staff = #{makeStaff}
+        </if>
+        <if test="makeTime != null">
+            AND t.make_time = #{makeTime}
+        </if>
+        <if test="cpId != null">
+            AND t.cp_id = #{cpId}
+        </if>
+
+        <if test="orgIdList != null and orgIdList.size() > 0">
+            AND t.org_id  =any(#{orgIdList, typeHandler=UuidListTypeHandler})
+        </if>
+        <if test="staffIdList != null and staffIdList.size() > 0">
+            AND t.staff_id  =any(#{staffIdList, typeHandler=UuidListTypeHandler})
+        </if>
+        <if test="makeTimeStart != null and makeTimeEnd != null">
+            AND t.make_time &gt;= #{makeTimeStart}::timestamp with time zone
+            AND t.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
+        </if>
+        <if test="flgValidList != null and flgValidList.size()>0">
+            AND t.flg_valid =any(#{flgValidList, typeHandler=BooleanListTypeHandler})
+        </if>
+
+        <if test="rpTypeList != null and rpTypeList.size() > 0">
+            AND t.rp_type  =any(#{rpTypeList, typeHandler=StringListTypeHandler})
+        </if>
+        <if test="staffIds != null and staffIds.size() > 0">
+            AND t.staff_id  =any(#{staffIdList, typeHandler=UuidListTypeHandler})
+        </if>
+        <if test="createtimeStart != null and createtimeEnd != null">
+            AND t.op_create_time &gt;= #{createtimeStart}::timestamp with time zone
+            AND t.op_create_time &lt; #{createtimeEnd}::timestamp with time zone + interval '1 day'
+        </if>
+
+        <if test="staffName != null and staffName != ''">
+            AND tms.staff_name LIKE concat('%',my_ex.likequery(#{staffName}),'%')
+        </if>
+        <if test="orgName != null and orgName != ''">
+            AND tmo.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
+        </if>
+
+        <if test="sumAmtReceivableHandleFlag != null and sumAmtReceivableHandleFlag == true">
+            AND t.sum_amt_receivable_handle > 0
+        </if>
+    </sql>
+
+
     <sql id="idsForeach">
     <sql id="idsForeach">
         <!-- 根据主键rpId批量操作 -->
         <!-- 根据主键rpId批量操作 -->
         WHERE rp_id in
         WHERE rp_id in
@@ -621,4 +744,93 @@
         DELETE FROM dkic_b.t_mac_rec_pay
         DELETE FROM dkic_b.t_mac_rec_pay
         WHERE rp_id = #{id}::uuid;
         WHERE rp_id = #{id}::uuid;
     </delete>
     </delete>
+
+
+
+
+    <!-- 查询表t_mac_rec_pay,(条件查询+分页)列表 -->
+    <select id="getRpSupList" 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,
+        tmsp.sup_id,
+        tmsp.sup_code,
+        tmsp.sup_name,
+        tmsp.sup_type,
+        tmsp.contact_name,
+        tmsp.contact_phone,
+        tmsp.return_address,
+        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
+        from dkic_b.t_mac_rec_pay as t
+        left join dkic_b.t_mst_supplier tmsp on tmsp.sup_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 ('对象类型-供应商')
+        where t.rp_type in ('收付款类型-付款', '收付款类型-退付款')
+        <include refid="Condition_sup"/>
+
+        <if test="searchText !=null and searchText != ''">
+            AND (  tmsp.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmsp.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmsp.sup_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="getRpSupListCount" resultType="Long">
+        SELECT count(1)
+        from dkic_b.t_mac_rec_pay as t
+        left join dkic_b.t_mst_supplier tmsp on tmsp.sup_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_sup"/>
+        <if test="searchText !=null and searchText != ''">
+            AND (  tmsp.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmsp.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmsp.sup_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>
 </mapper>
 </mapper>

+ 14 - 0
src/main/java/com/dk/mdm/model/response/mac/RecPayResponse.java

@@ -304,6 +304,20 @@ public class RecPayResponse extends PageInfo<RecPayResponse> implements Serializ
     @ApiModelProperty(value = "供应商名称")
     @ApiModelProperty(value = "供应商名称")
     private String supName;
     private String supName;
 
 
+    @ApiModelProperty(value = "供应商id")
+    private String supId;
+
+    @ApiModelProperty(value = "供应商类信息")
+    private String supType;
+
+    @ApiModelProperty(value = "联系人")
+    private String contactName;
+
+    @ApiModelProperty(value = "联系电话")
+    private String contactPhone;
+
+    @ApiModelProperty(value = "退货地址")
+    private String returnAddress;
 
 
     /**
     /**
      * 资金账户编码
      * 资金账户编码

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

@@ -732,4 +732,13 @@ public class ReceiptService extends BaseService<RecPay> {
         return ResponseResultUtil.success(result);
         return ResponseResultUtil.success(result);
     }
     }
 
 
+
+
+    @Pagination
+    public ResponseResultVO<PageList<RecPayResponse>> getRpSupList(RecPayQuery recPayQuery) {
+        return super.mergeListWithCount(recPayQuery, recPayMapper.getRpSupList(recPayQuery),
+            recPayMapper.getRpSupListCount(recPayQuery));
+
+    }
+
 }
 }