于继渤 2 лет назад
Родитель
Сommit
9c2a0743ea

+ 4 - 1
src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml

@@ -95,6 +95,7 @@
 
         <result column="follow_staff" property="followStaff"/>
         <result column="follow_staff_name" property="followStaffName"/>
+        <result column="receivable_residue" property="receivableResidue"/>
 
     </resultMap>
 
@@ -209,7 +210,8 @@
         tms.staff_name  AS  "staffName",
         tms2.staff_name  AS  "reportStaffName",
         tdk.kind_name_i18n  ->> 'zh_CN' AS "saleStatusName",
-        tcf.next_follow_time
+        tcf.next_follow_time,
+        tma.receivable_residue
         FROM dkic_b.t_mst_customer tmc
         LEFT JOIN  ( select tccff.cus_id, max (tccff.next_follow_time)as next_follow_time from dkic_b.t_crm_cus_follow tccff group by tccff.cus_id )  tcf on tmc.cus_id = tcf.cus_id
         LEFT JOIN  dkic_b.t_mst_dictionary_data tmd  on tmd.data_id =  tmc.cus_from
@@ -218,6 +220,7 @@
         LEFT JOIN  dkic_b.t_mst_staff tms  on tms.staff_id =  tmc.staff_id
         LEFT JOIN  dkic_b.t_mst_staff tms2  on tms2.staff_id =  tmc.report_staff
         LEFT JOIN  sys.t_data_kind tdk  on tdk.kind_code =  tmc.sale_status
+        LEFT JOIN  dkic_b.t_mac_account tma  on tma.object_id =  tmc.cus_id
         <include refid="Condition"/>
         order by tmc.cus_id DESC
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">

+ 4 - 0
src/main/java/com/dk/mdm/model/response/mst/CustomerResponse.java

@@ -22,6 +22,7 @@ import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.List;
 
@@ -305,6 +306,9 @@ public class CustomerResponse extends PageInfo<CustomerResponse> implements Seri
     @TableField(typeHandler = TimestampTypeHandler.class)
     private LocalDateTime nextFollowTime;
 
+    @ApiModelProperty(value = "总剩余应收 (总应收账款-总应收收款金额-总应收优惠金额)")
+    private BigDecimal receivableResidue;
+
 
     private static final long serialVersionUID = 1L;