fubin 2 лет назад
Родитель
Сommit
8cd831480a

+ 1 - 1
src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.xml

@@ -179,7 +179,7 @@
                t.flg_valid,
                t.cp_id,
                tmw.wh_name                                      as "whName",
-               sys.f_get_name_i18n(tdk.kind_name_i18n, 'zh_CN') as "outStatusName"
+               sys.f_get_name_i18n(tdk.kind_name_i18n, #{i18n}) as "outStatusName"
         FROM t_psi_outbound_item as t
                  left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = t.sku_id
                  left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = t.inv_id

+ 29 - 8
src/main/java/com/dk/mdm/mapper/ivt/OutboundMapper.xml

@@ -84,7 +84,7 @@
     <sql id="Condition">
         <where>
             <if test="outNo != null and outNo != ''">
-                AND t.out_no = #{outNo}
+                AND t.out_no LIKE concat('%',my_ex.likequery(#{outNo}),'%')
             </if>
             <if test="outType != null and outType != ''">
                 AND t.out_type = #{outType}
@@ -128,9 +128,6 @@
             <if test="returnAmt != null">
                 AND t.return_amt = #{returnAmt}
             </if>
-            <if test="outDate != null">
-                AND t.out_date = #{outDate}
-            </if>
             <if test="remarks != null and remarks != ''">
                 AND t.remarks = #{remarks}
             </if>
@@ -140,9 +137,6 @@
             <if test="makeStaff != null and makeStaff != ''">
                 AND t.make_staff = #{makeStaff}
             </if>
-            <if test="makeTime != null">
-                AND t.make_time = #{makeTime}
-            </if>
             <if test="receivableId != null and receivableId != ''">
                 AND t.receivable_id = #{receivableId}
             </if>
@@ -155,6 +149,32 @@
             <if test="cpId != null">
                 AND t.cp_id = #{cpId}
             </if>
+            <if test="orderNo != null and orderNo != ''">
+                AND t.from_no LIKE concat('%',my_ex.likequery(#{orderNo}),'%')
+            </if>
+            <if test="cusPhone != null and cusPhone != ''">
+                AND tmc.cus_phone LIKE concat('%',my_ex.likequery(#{cusPhone}),'%')
+            </if>
+            <if test="cusName != null and cusName != ''">
+                AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
+            </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="outStatusList != null and outStatusList.size() > 0">
+                AND t.out_status  =any(#{outStatusList, typeHandler=StringListTypeHandler})
+            </if>
+            <if test="outDateStart != null and outDateEnd != null">
+                AND t.out_date &gt;= #{outDateStart}::timestamp with time zone
+                AND t.out_date &lt; #{outDateEnd}::timestamp with time zone + interval '1 day'
+            </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>
         </where>
     </sql>
 
@@ -188,7 +208,7 @@
                tmdd.data_value                                   as "cusFromName",
                t.sup_id,
                t.out_status,
-               sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "outStatusName",
+               sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "outStatusName",
                t.outing_qty,
                t.outing_amt,
                t.out_qty,
@@ -223,6 +243,7 @@
         SELECT
         count(1)
         FROM t_psi_outbound as t
+                left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
         <include refid="Condition"/>
     </select>
 

+ 21 - 17
src/main/java/com/dk/mdm/mapper/sale/OrderMapper.xml

@@ -106,7 +106,7 @@
     <sql id="Condition">
         <where>
             <if test="orderNo != null and orderNo != ''">
-                AND t.order_no = #{orderNo}
+                AND t.order_no LIKE concat('%',my_ex.likequery(#{orderNo}),'%')
             </if>
             <if test="orderType != null and orderType != ''">
                 AND t.order_type = #{orderType}
@@ -133,20 +133,17 @@
                 AND t.address_gcj02 = #{addressGcj02}
             </if>
             <if test="addressFull != null and addressFull != ''">
-                AND t.address_full = #{addressFull}
+                AND t.address_full LIKE concat('%',my_ex.likequery(#{addressFull}),'%')
             </if>
             <if test="contactName != null and contactName != ''">
-                AND t.contact_name = #{contactName}
+                AND t.contact_name LIKE concat('%',my_ex.likequery(#{contactName}),'%')
             </if>
             <if test="contactPhone != null and contactPhone != ''">
-                AND t.contact_phone = #{contactPhone}
+                AND t.contact_phone LIKE concat('%',my_ex.likequery(#{contactPhone}),'%')
             </if>
             <if test="salesChannel != null and salesChannel != ''">
                 AND t.sales_channel = #{salesChannel}
             </if>
-            <if test="deliveryDate != null">
-                AND t.delivery_date = #{deliveryDate}
-            </if>
             <if test="sumQuantity != null">
                 AND t.sum_quantity = #{sumQuantity}
             </if>
@@ -210,6 +207,12 @@
             <if test="cpId != null">
                 AND t.cp_id = #{cpId}
             </if>
+            <if test="cusPhone != null and cusPhone != ''">
+                AND tmc.cus_phone LIKE concat('%',my_ex.likequery(#{cusPhone}),'%')
+            </if>
+            <if test="cusName != null and cusName != ''">
+                AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
+            </if>
             <if test="orgIdList != null and orgIdList.size() > 0">
                 AND t.org_id  =any(#{orgIdList, typeHandler=uuidListTypeHandler})
             </if>
@@ -219,14 +222,14 @@
             <if test="outStatusList != null and outStatusList.size() > 0">
                 AND t.out_status  =any(#{outStatusList, typeHandler=StringListTypeHandler})
             </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="deliveryDateStart != null and deliveryDateEnd != null">
                 AND t.delivery_date &gt;= #{deliveryDateStart}::timestamp with time zone
                 AND t.delivery_date &lt; #{deliveryDateEnd}::timestamp with time zone + interval '1 day'
             </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>
         </where>
     </sql>
 
@@ -243,7 +246,7 @@
         SELECT t.order_id,
                t.order_no,
                t.order_type,
-               sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "orderTypeName",
+               sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "orderTypeName",
                t.org_id,
                tmo.org_name                                      as "orgName",
                t.staff_id,
@@ -269,9 +272,9 @@
                t.sum_amount,
                t.sale_discount,
                t.order_status,
-               sys.f_get_name_i18n(tdk2.kind_name_i18n, 'zh_CN') as "orderStatusName",
+               sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "orderStatusName",
                t.out_status,
-               sys.f_get_name_i18n(tdk3.kind_name_i18n, 'zh_CN') as "outStatusName",
+               sys.f_get_name_i18n(tdk3.kind_name_i18n, #{i18n}) as "outStatusName",
                t.outing_qty,
                t.outing_amt,
                t.out_qty,
@@ -308,6 +311,7 @@
         SELECT
         count(1)
         FROM dkic_b.t_psi_order as t
+                left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
         <include refid="Condition"/>
     </select>
 
@@ -316,7 +320,7 @@
         SELECT t.order_id,
                t.order_no,
                t.order_type,
-               sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "orderTypeName",
+               sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "orderTypeName",
                t.org_id,
                tmo.org_name                                      as "orgName",
                t.staff_id,
@@ -342,9 +346,9 @@
                t.sum_amount,
                t.sale_discount,
                t.order_status,
-               sys.f_get_name_i18n(tdk2.kind_name_i18n, 'zh_CN') as "orderStatusName",
+               sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "orderStatusName",
                t.out_status,
-               sys.f_get_name_i18n(tdk3.kind_name_i18n, 'zh_CN') as "outStatusName",
+               sys.f_get_name_i18n(tdk3.kind_name_i18n, #{i18n}) as "outStatusName",
                t.outing_qty,
                t.outing_amt,
                t.out_qty,

+ 28 - 13
src/main/java/com/dk/mdm/mapper/sale/OutReturnMapper.xml

@@ -106,7 +106,7 @@
     <sql id="Condition">
         <where>
             <if test="returnNo != null and returnNo != ''">
-                AND t.return_no = #{returnNo}
+                AND t.return_no LIKE concat('%',my_ex.likequery(#{returnNo}),'%')
             </if>
             <if test="returnType != null and returnType != ''">
                 AND t.return_type = #{returnType}
@@ -115,7 +115,7 @@
                 AND t.order_id = #{orderId}
             </if>
             <if test="orderNo != null and orderNo != ''">
-                AND t.order_no = #{orderNo}
+                AND t.order_no LIKE concat('%',my_ex.likequery(#{orderNo}),'%')
             </if>
             <if test="orgId != null and orgId != ''">
                 AND t.org_id = #{orgId}
@@ -139,20 +139,17 @@
                 AND t.address_gcj02 = #{addressGcj02}
             </if>
             <if test="addressFull != null and addressFull != ''">
-                AND t.address_full = #{addressFull}
+                AND t.address_full LIKE concat('%',my_ex.likequery(#{addressFull}),'%')
             </if>
             <if test="contactName != null and contactName != ''">
-                AND t.contact_name = #{contactName}
+                AND t.contact_name LIKE concat('%',my_ex.likequery(#{contactName}),'%')
             </if>
             <if test="contactPhone != null and contactPhone != ''">
-                AND t.contact_phone = #{contactPhone}
+                AND t.contact_phone LIKE concat('%',my_ex.likequery(#{contactPhone}),'%')
             </if>
             <if test="salesChannel != null and salesChannel != ''">
                 AND t.sales_channel = #{salesChannel}
             </if>
-            <if test="pickupDate != null">
-                AND t.pickup_date = #{pickupDate}
-            </if>
             <if test="sumQuantity != null">
                 AND t.sum_quantity = #{sumQuantity}
             </if>
@@ -201,15 +198,32 @@
             <if test="makeStaff != null and makeStaff != ''">
                 AND t.make_staff = #{makeStaff}
             </if>
-            <if test="makeTime != null">
-                AND t.make_time = #{makeTime}
-            </if>
             <if test="flgValid != null">
                 AND t.flg_valid = #{flgValid}
             </if>
             <if test="cpId != null">
                 AND t.cp_id = #{cpId}
             </if>
+            <if test="cusPhone != null and cusPhone != ''">
+                AND tmc.cus_phone LIKE concat('%',my_ex.likequery(#{cusPhone}),'%')
+            </if>
+            <if test="cusName != null and cusName != ''">
+                AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
+            </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="pickupDateStart != null and pickupDateEnd != null">
+                AND t.pickup_date &gt;= #{pickupDateStart}::timestamp with time zone
+                AND t.pickup_date &lt; #{pickupDateEnd}::timestamp with time zone + interval '1 day'
+            </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>
         </where>
     </sql>
 
@@ -253,9 +267,9 @@
                t.sum_amount,
                t.sale_discount,
                t.return_status,
-               sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "returnStatusName",
+               sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "returnStatusName",
                t.into_status,
-               sys.f_get_name_i18n(tdk2.kind_name_i18n, 'zh_CN') as "intoStatusName",
+               sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "intoStatusName",
                t.intoing_qty,
                t.intoing_amt,
                t.into_qty,
@@ -290,6 +304,7 @@
         SELECT
         count(1)
         FROM t_psi_out_return as t
+                left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
         <include refid="Condition"/>
     </select>
 

+ 34 - 0
src/main/java/com/dk/mdm/model/query/ivt/OutboundQuery.java

@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.List;
 
 /**
  *  出库单
@@ -317,6 +318,39 @@ public class OutboundQuery extends PageInfo<OutboundQuery> implements Serializab
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
+    @ApiModelProperty(value = "订单单号")
+    private String orderNo;
+
+    @ApiModelProperty(value = "客户电话")
+    private String cusPhone;
+
+    @ApiModelProperty(value = "客户名称")
+    private String cusName;
+
+    @ApiModelProperty(value = "部门List")
+    private List<String> orgIdList;
+
+    @ApiModelProperty(value = "业务员List")
+    private List<String> staffIdList;
+
+    @ApiModelProperty(value = "出库状态List")
+    private List<String> outStatusList;
+
+    @ApiModelProperty(value = "制单时间开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeStart;
+
+    @ApiModelProperty(value = "制单时间结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeEnd;
+
+    @ApiModelProperty(value = "出库日期开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate outDateStart;
+
+    @ApiModelProperty(value = "出库日期结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate outDateEnd;
 
     /*
      * 相关属性

+ 6 - 0
src/main/java/com/dk/mdm/model/query/sale/OrderQuery.java

@@ -407,6 +407,12 @@ public class OrderQuery extends PageInfo<OrderQuery> implements Serializable {
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
+    @ApiModelProperty(value = "客户电话")
+    private String cusPhone;
+
+    @ApiModelProperty(value = "客户名称")
+    private String cusName;
+
     @ApiModelProperty(value = "部门List")
     private List<String> orgIdList;
 

+ 28 - 0
src/main/java/com/dk/mdm/model/query/sale/OutReturnQuery.java

@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.List;
 
 /**
  *  出库退货
@@ -405,6 +406,33 @@ public class OutReturnQuery extends PageInfo<OutReturnQuery> implements Serializ
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
+    @ApiModelProperty(value = "客户电话")
+    private String cusPhone;
+
+    @ApiModelProperty(value = "客户名称")
+    private String cusName;
+
+    @ApiModelProperty(value = "部门List")
+    private List<String> orgIdList;
+
+    @ApiModelProperty(value = "业务员List")
+    private List<String> staffIdList;
+
+    @ApiModelProperty(value = "制单时间开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeStart;
+
+    @ApiModelProperty(value = "制单时间结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeEnd;
+
+    @ApiModelProperty(value = "提货日期开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate pickupDateStart;
+
+    @ApiModelProperty(value = "提货日期结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate pickupDateEnd;
 
     /*
      * 相关属性