fubin 2 лет назад
Родитель
Сommit
3ffb04f19b

+ 3 - 3
src/main/java/com/dk/mdm/mapper/mac/AccountItemMapper.java

@@ -15,14 +15,14 @@ import java.util.Map;
 @Repository
 public interface AccountItemMapper extends BaseMapper<AccountItem>{
     /**
-     * @desc : 根据条件进行查询
+     * @desc : 查询应收账款明细
      * @author : 付斌
      * @date : 2024-02-28 10:18
      */
-    List<AccountItemResponse> selectByCond(AccountItemQuery accountItemQuery);
+    List<AccountItemResponse> getReceivableAccountItem(AccountItemQuery accountItemQuery);
 
     /**
-     * @desc : 根据条件进行查询
+     * @desc : 查询应付账款明细
      * @author : 付斌
      * @date : 2024-02-28 10:18
      */

+ 45 - 28
src/main/java/com/dk/mdm/mapper/mac/AccountItemMapper.xml

@@ -130,24 +130,44 @@
         </foreach>
     </sql>
 
-    <!-- 查询表t_mac_account_item,(条件查询+分页)列表 -->
-    <select id="getPayableAccountItem" resultMap="BaseResultMapResponse">
+    <!-- 根据主键查询表t_mac_account_item的一行数据 -->
+    <select id="selectByCond" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM dkic_b.t_mac_account_item as t
+        where 1 = 1
+        <include refid="Condition"/>
+    </select>
+
+    <!-- 查询表t_mac_account_item,(条件查询)个数 -->
+    <select id="countByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM dkic_b.t_mac_account_item as t
+        where 1 = 1
+        <include refid="Condition"/>
+    </select>
+
+
+    <!-- 查询应收账款明细 -->
+    <select id="getReceivableAccountItem" resultMap="BaseResultMapResponse">
         SELECT t.item_id,
                t.acc_item_type,
                t.object_id,
-               tms.sup_code       as "supCode",
-               tms.sup_name       as "supName",
-               tms.contact_phone  as "contactPhone",
-               tms.return_address as "returnAddress",
+               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",
+               tmo.org_name                                      as "orgName",
                t.staff_id,
-               tms.staff_name     as "staffName",
+               tms.staff_name                                    as "staffName",
                t.biznis_type,
                t.biznis_id,
                t.biznis_no,
                t.acc_date,
                t.rec_status,
+               sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "recStatusName",
                t.amt_rec,
                t.amt_pay,
                t.amt_should,
@@ -160,35 +180,38 @@
                t.flg_valid,
                t.cp_id
         FROM dkic_b.t_mac_account_item as t
-                 left join dkic_b.t_mst_supplier tms on tms.sup_id = t.object_id
+                 left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
                  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 sys.t_data_kind as tdk1 on t.rec_status = tdk1.kind_code
         where t.flg_valid
-          and t.acc_item_type = '账款类型-应付'
+          and t.acc_item_type = '账款类型-应收'
+          and t.amt_residue > 0
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
     </select>
 
-    <!-- 查询表t_mac_account_item,(条件查询+分页)列表 -->
-    <select id="selectByCond" resultMap="BaseResultMapResponse">
+    <!-- 查询应付账款明细 -->
+    <select id="getPayableAccountItem" resultMap="BaseResultMapResponse">
         SELECT t.item_id,
                t.acc_item_type,
                t.object_id,
-               tmc.cus_code     as "cusCode",
-               tmc.cus_name     as "cusName",
-               tmc.cus_phone    as "cusPhone",
-               tmc.address_full as "addressFull",
+               tms.sup_code       as "supCode",
+               tms.sup_name       as "supName",
+               tms.contact_phone  as "contactPhone",
+               tms.return_address as "returnAddress",
                t.org_id,
-               tmo.org_name     as "orgName",
+               tmo.org_name       as "orgName",
                t.staff_id,
-               tms.staff_name   as "staffName",
+               tms.staff_name     as "staffName",
                t.biznis_type,
                t.biznis_id,
                t.biznis_no,
                t.acc_date,
                t.rec_status,
+               sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "recStatusName",
                t.amt_rec,
                t.amt_pay,
                t.amt_should,
@@ -201,25 +224,19 @@
                t.flg_valid,
                t.cp_id
         FROM dkic_b.t_mac_account_item as t
-                 left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
+                 left join dkic_b.t_mst_supplier tms on tms.sup_id = t.object_id
                  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 sys.t_data_kind as tdk1 on t.rec_status = tdk1.kind_code
         where t.flg_valid
-          and t.acc_item_type = '账款类型-应收'
+          and t.acc_item_type = '账款类型-应付'
+          and t.amt_residue > 0
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
     </select>
 
-    <!-- 查询表t_mac_account_item,(条件查询)个数 -->
-    <select id="countByCond" resultType="Long">
-        SELECT
-        count(1)
-        FROM dkic_b.t_mac_account_item
-        where 1=1
-        <include refid="Condition"/>
-    </select>
 
     <!-- 根据主键查询表t_mac_account_item的一行数据 -->
     <select id="selectById" resultMap="BaseResultMap">

+ 3 - 0
src/main/java/com/dk/mdm/model/response/mac/AccountItemResponse.java

@@ -233,6 +233,9 @@ public class AccountItemResponse extends PageInfo<AccountItemResponse> implement
     @ApiModelProperty(value = "详细地址")
     private String addressFull;
 
+    @ApiModelProperty(value = "账务状态")
+    private String recStatusName;
+
     private static final long serialVersionUID = 1L;
 
 }

+ 2 - 2
src/main/java/com/dk/mdm/service/mac/AccountService.java

@@ -60,7 +60,7 @@ public class AccountService extends BaseService<Account> {
     public ResponseResultVO selectById(String id) {
         //根据id查询
         AccountResponse accountResponse = accountMapper.selectById(id);
-        List<AccountItemResponse> accountItemResponses = accountItemMapper.selectByCond(new AccountItemQuery().setObjectId(id));
+        List<AccountItemResponse> accountItemResponses = accountItemMapper.getReceivableAccountItem(new AccountItemQuery().setObjectId(id));
         accountResponse.setList(accountItemResponses);
         return ResponseResultUtil.success(accountResponse);
     }
@@ -72,7 +72,7 @@ public class AccountService extends BaseService<Account> {
      */
     @Pagination
     public ResponseResultVO<?> getReceivableAccountItem(AccountItemQuery accountItemQuery) {
-        List<AccountItemResponse> accountItemResponse = accountItemMapper.selectByCond(accountItemQuery);
+        List<AccountItemResponse> accountItemResponse = accountItemMapper.getReceivableAccountItem(accountItemQuery);
         return ResponseResultUtil.success(accountItemResponse);
     }