Browse Source

状态

master
常熟吴彦祖 2 days ago
parent
commit
7167133f24
  1. 85
      src/main/java/com/xujie/modules/order/vo/PODetailVo.java
  2. 60
      src/main/java/com/xujie/modules/order/vo/PoDetailAdvancedQueryVo.java
  3. 79
      src/main/resources/mapper/order/PODetailMapper.xml

85
src/main/java/com/xujie/modules/order/vo/PODetailVo.java

@ -12,6 +12,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
@ -385,7 +386,91 @@ public class PODetailVo extends QueryPage {
@ApiModelProperty(value = "扩展字段值")
private Map<String, Object> extValues = new LinkedHashMap<String, Object>();
/**
* 顶部筛选:计划员账号。只匹配 POHeader.c_planner,不匹配显示名。
* 使用独立字段,避免命中旧查询里“账号或显示名”的条件。
*/
private String plannerAccount;
/**
* 顶部筛选:Buyer 关键字。模糊匹配 POHeader.buyer。
* 不复用 buyer,避免走旧 SQL 的字符串拼接条件。
*/
private String buyerKeyword;
/**
* 顶部筛选:供应商名称关键字。模糊匹配供应商名称。
*/
private String supplierNameKeyword;
/**
* 顶部筛选:PO 号关键字。模糊匹配 POHeader.po_no。
*/
private String poNoKeyword;
/**
* 顶部筛选:物料 Item 关键字。匹配 COALESCE(物料 item, 订单行 item)。
*/
private String itemKeyword;
/**
* 顶部筛选:LOGISTICS ID,对应订单行 FLEXID(c_flexid)。
*/
private String flexidKeyword;
/**
* 顶部筛选:运输方式多选。值为 ship_method.method_desc,命中任意一个即可。
* 空列表表示不按运输方式过滤。
*/
private List<String> shipViaList;
/**
* 顶部筛选:映射后的状态多选。值为显示状态,多个原始状态共用同一显示名时都会命中。
* 空列表表示不按状态过滤。
*/
private List<String> statusDisplayList;
/**
* 顶部筛选:目的港多选。值为港口编码 port_code,精确匹配 POHeader.c_destination。
* 空列表表示不按目的港过滤。
*/
private List<String> destinationList;
/**
* 顶部筛选:Telex Release 的库值。Yes 对应 true,No 对应 false。
* 空字符串表示不筛选,空库值只在未选择时出现。
*/
private String telexReleaseValue;
/** PO Enquiry Date 起,含当天,对应 POHeader.c_enquiry。空表示不限制开始。 */
private String enquiryDateStart;
/** PO Enquiry Date 止,含当天。空表示不限制结束。 */
private String enquiryDateEnd;
/** PO Issue Date 起,含当天,对应 POHeader.order_date(D_Issue)。 */
private String issueDateStart;
/** PO Issue Date 止,含当天。 */
private String issueDateEnd;
/** ETA 起,含当天,对应 PODetail.c_eta。 */
private String etaDateStart;
/** ETA 止,含当天。 */
private String etaDateEnd;
/** OBD 起,含当天,对应 PODetail.c_obd。 */
private String obdDateStart;
/** OBD 止,含当天。 */
private String obdDateEnd;
/** CRD 起,含当天,对应 PODetail.c_crd(D_CRD)。 */
private String crdDateStart;
/** CRD 止,含当天。 */
private String crdDateEnd;
public Object getKey() {
return this.id;

60
src/main/java/com/xujie/modules/order/vo/PoDetailAdvancedQueryVo.java

@ -51,4 +51,64 @@ public class PoDetailAdvancedQueryVo extends QueryPage {
@ApiModelProperty(value = "动态条件列表,条件之间固定 AND")
private List<PoDetailQueryCondition> conditions;
/** 顶部 Planner:只匹配计划员账号。空则不筛选。 */
private String plannerAccount;
/** 顶部 Buyer 关键字,模糊匹配。空则不筛选。 */
private String buyerKeyword;
/** 顶部供应商名称关键字,模糊匹配。空则不筛选。 */
private String supplierNameKeyword;
/** 顶部 PO 号关键字,模糊匹配。空则不筛选。 */
private String poNoKeyword;
/** 顶部 Item 关键字,匹配物料关联 Item。空则不筛选。 */
private String itemKeyword;
/** 顶部 LOGISTICS ID,匹配 FLEXID。空则不筛选。 */
private String flexidKeyword;
/** 顶部运输方式多选,命中任意一个。空列表不筛选。 */
private List<String> shipViaList;
/** 顶部映射后状态多选,命中任意一个。空列表不筛选。 */
private List<String> statusDisplayList;
/** 顶部目的港编码多选,精确匹配。空列表不筛选。 */
private List<String> destinationList;
/** Telex Release 库值:true / false。空则不筛选。 */
private String telexReleaseValue;
/** PO Enquiry Date 起,含当天。 */
private String enquiryDateStart;
/** PO Enquiry Date 止,含当天。 */
private String enquiryDateEnd;
/** PO Issue Date 起,含当天,对应 order_date。 */
private String issueDateStart;
/** PO Issue Date 止,含当天。 */
private String issueDateEnd;
/** ETA 起,含当天。 */
private String etaDateStart;
/** ETA 止,含当天。 */
private String etaDateEnd;
/** OBD 起,含当天。 */
private String obdDateStart;
/** OBD 止,含当天。 */
private String obdDateEnd;
/** CRD 起,含当天,对应 c_crd。 */
private String crdDateStart;
/** CRD 止,含当天。 */
private String crdDateEnd;
}

79
src/main/resources/mapper/order/PODetailMapper.xml

@ -17,6 +17,83 @@
</if>
</sql>
<!--
rqrq - 三个 PO 页面共用的顶部筛选。
文本为模糊包含;多选命中任意一个;日期为闭区间,只填一端则按单边过滤。
空值不参与条件。字段名与旧查询分开,避免命中 ${} 拼接条件。
-->
<sql id="poOrderTopSearchFilter">
<if test="query.plannerAccount != null and query.plannerAccount != ''">
AND poh.c_planner LIKE CONCAT('%', #{query.plannerAccount}, '%')
</if>
<if test="query.buyerKeyword != null and query.buyerKeyword != ''">
AND poh.buyer LIKE CONCAT('%', #{query.buyerKeyword}, '%')
</if>
<if test="query.supplierNameKeyword != null and query.supplierNameKeyword != ''">
AND ss.supplier_name LIKE CONCAT('%', #{query.supplierNameKeyword}, '%')
</if>
<if test="query.poNoKeyword != null and query.poNoKeyword != ''">
AND poh.po_no LIKE CONCAT('%', #{query.poNoKeyword}, '%')
</if>
<if test="query.itemKeyword != null and query.itemKeyword != ''">
AND COALESCE(p.item, pod.item) LIKE CONCAT('%', #{query.itemKeyword}, '%')
</if>
<if test="query.flexidKeyword != null and query.flexidKeyword != ''">
AND pod.c_flexid LIKE CONCAT('%', #{query.flexidKeyword}, '%')
</if>
<if test="query.telexReleaseValue != null and query.telexReleaseValue != ''">
AND pod.c_telex_release = #{query.telexReleaseValue}
</if>
<if test="query.shipViaList != null and query.shipViaList.size() &gt; 0">
AND poh.ship_via IN
<foreach collection="query.shipViaList" item="shipViaItem" open="(" separator="," close=")">
#{shipViaItem}
</foreach>
</if>
<if test="query.statusDisplayList != null and query.statusDisplayList.size() &gt; 0">
AND (<include refid="statusDisplayExpression"/>) IN
<foreach collection="query.statusDisplayList" item="statusDisplayItem" open="(" separator="," close=")">
#{statusDisplayItem}
</foreach>
</if>
<if test="query.destinationList != null and query.destinationList.size() &gt; 0">
AND poh.c_destination IN
<foreach collection="query.destinationList" item="destinationItem" open="(" separator="," close=")">
#{destinationItem}
</foreach>
</if>
<if test="query.enquiryDateStart != null and query.enquiryDateStart != ''">
AND CAST(poh.c_enquiry AS DATE) &gt;= CAST(#{query.enquiryDateStart} AS DATE)
</if>
<if test="query.enquiryDateEnd != null and query.enquiryDateEnd != ''">
AND CAST(poh.c_enquiry AS DATE) &lt;= CAST(#{query.enquiryDateEnd} AS DATE)
</if>
<if test="query.issueDateStart != null and query.issueDateStart != ''">
AND CAST(poh.order_date AS DATE) &gt;= CAST(#{query.issueDateStart} AS DATE)
</if>
<if test="query.issueDateEnd != null and query.issueDateEnd != ''">
AND CAST(poh.order_date AS DATE) &lt;= CAST(#{query.issueDateEnd} AS DATE)
</if>
<if test="query.etaDateStart != null and query.etaDateStart != ''">
AND CAST(pod.c_eta AS DATE) &gt;= CAST(#{query.etaDateStart} AS DATE)
</if>
<if test="query.etaDateEnd != null and query.etaDateEnd != ''">
AND CAST(pod.c_eta AS DATE) &lt;= CAST(#{query.etaDateEnd} AS DATE)
</if>
<if test="query.obdDateStart != null and query.obdDateStart != ''">
AND CAST(pod.c_obd AS DATE) &gt;= CAST(#{query.obdDateStart} AS DATE)
</if>
<if test="query.obdDateEnd != null and query.obdDateEnd != ''">
AND CAST(pod.c_obd AS DATE) &lt;= CAST(#{query.obdDateEnd} AS DATE)
</if>
<if test="query.crdDateStart != null and query.crdDateStart != ''">
AND CAST(pod.c_crd AS DATE) &gt;= CAST(#{query.crdDateStart} AS DATE)
</if>
<if test="query.crdDateEnd != null and query.crdDateEnd != ''">
AND CAST(pod.c_crd AS DATE) &lt;= CAST(#{query.crdDateEnd} AS DATE)
</if>
</sql>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.xujie.modules.order.entity.PODetail">
<id column="order_no" property="orderNo" />
@ -300,6 +377,7 @@
<include refid="statusDisplayJoin"/>
where pod.site = '${query.site}'
<include refid="statusDisplayFilter"/>
<include refid="poOrderTopSearchFilter"/>
<if test="query.poHeaderId != null and query.poHeaderId != '' "> and pod.po_header_id like '%${query.poHeaderId}%'</if>
<if test="query.orderNo != null and query.orderNo != '' "> and pod.order_no like '%${query.orderNo}%'</if>
<if test="query.poNo != null and query.poNo != '' "> and poh.po_no like '%${query.poNo}%'</if>
@ -479,6 +557,7 @@
<include refid="statusDisplayJoin"/>
where pod.site = #{query.site}
<include refid="statusDisplayFilter"/>
<include refid="poOrderTopSearchFilter"/>
<if test="query.customer != null and query.customer != ''"> and poh.c_customer = #{query.customer}</if>
<if test="query.buyer != null and query.buyer != ''"> and poh.buyer like CONCAT('%', #{query.buyer}, '%')</if>
<if test="query.poNo != null and query.poNo != ''"> and poh.po_no like CONCAT('%', #{query.poNo}, '%')</if>

Loading…
Cancel
Save