feat(bid): 新增甲方履约订单管理模块
1. 新增甲方履约菜单分类,包含待发、在途、签收三个子菜单并配置权限 2. 重构发货单号生成逻辑,支持区分供应商和甲方履约订单前缀 3. 新增甲方发货单生成功能,可从确认的甲方报价单一键创建 4. 新增京东红主题样式并支持快速切换 5. 优化物料发货记录查询,兼容两种履约订单的客户信息关联 6. 修复订单详情弹窗的空值判断和异常捕获逻辑 7. 新增配套SQL脚本用于菜单初始化和数据修复
This commit is contained in:
@@ -26,6 +26,9 @@ public class BizDeliveryOrder extends BaseEntity {
|
||||
private List<BizDeliveryOrderItem> items;
|
||||
private String supplierName;
|
||||
private Integer itemCount;
|
||||
private String type;
|
||||
private Long clientQuoteId;
|
||||
private String clientName;
|
||||
|
||||
public Long getDoId() { return doId; }
|
||||
public void setDoId(Long doId) { this.doId = doId; }
|
||||
@@ -59,4 +62,10 @@ public class BizDeliveryOrder extends BaseEntity {
|
||||
public void setSupplierName(String supplierName) { this.supplierName = supplierName; }
|
||||
public Integer getItemCount() { return itemCount; }
|
||||
public void setItemCount(Integer itemCount) { this.itemCount = itemCount; }
|
||||
public String getType() { return type; }
|
||||
public void setType(String type) { this.type = type; }
|
||||
public Long getClientQuoteId() { return clientQuoteId; }
|
||||
public void setClientQuoteId(Long clientQuoteId) { this.clientQuoteId = clientQuoteId; }
|
||||
public String getClientName() { return clientName; }
|
||||
public void setClientName(String clientName) { this.clientName = clientName; }
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ public class BizDeliveryOrderServiceImpl implements IBizDeliveryOrderService {
|
||||
@Transactional
|
||||
public int insertBizDeliveryOrder(BizDeliveryOrder record) {
|
||||
if (record.getDoNo() == null || record.getDoNo().isEmpty()) {
|
||||
record.setDoNo("DO" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
|
||||
String prefix = "client".equals(record.getType()) ? "CD" : "DO";
|
||||
record.setDoNo(prefix + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
|
||||
}
|
||||
if (record.getDeliveryStatus() == null || record.getDeliveryStatus().isEmpty()) {
|
||||
record.setDeliveryStatus("pending");
|
||||
|
||||
@@ -23,19 +23,27 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="supplierName" column="supplier_name"/>
|
||||
<result property="itemCount" column="item_count"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="clientQuoteId" column="client_quote_id"/>
|
||||
<result property="clientName" column="client_name"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectBizDeliveryOrderList" resultMap="BaseRM">
|
||||
SELECT d.*, s.supplier_name,
|
||||
COALESCE(cl.client_name, cq.client_name) AS client_name,
|
||||
(SELECT COUNT(*) FROM biz_delivery_order_item WHERE do_id = d.do_id) AS item_count
|
||||
FROM biz_delivery_order d
|
||||
LEFT JOIN biz_supplier s ON d.supplier_id=s.supplier_id
|
||||
LEFT JOIN biz_client_quote cq ON d.client_quote_id = cq.quote_id
|
||||
LEFT JOIN biz_client cl ON cq.client_id = cl.client_id
|
||||
<where>
|
||||
<if test="tenantId != null"> AND d.tenant_id=#{tenantId}</if>
|
||||
<if test="type != null and type != ''"> AND d.type=#{type}</if>
|
||||
<if test="doNo != null and doNo != ''"> AND d.do_no LIKE CONCAT('%',#{doNo},'%')</if>
|
||||
<if test="supplierId != null"> AND d.supplier_id=#{supplierId}</if>
|
||||
<if test="deliveryStatus != null and deliveryStatus != ''"> AND d.delivery_status=#{deliveryStatus}</if>
|
||||
<if test="supplierName != null and supplierName != ''"> AND s.supplier_name LIKE CONCAT('%',#{supplierName},'%')</if>
|
||||
<if test="clientName != null and clientName != ''"> AND cl.client_name LIKE CONCAT('%',#{clientName},'%')</if>
|
||||
</where>
|
||||
ORDER BY d.create_time DESC
|
||||
</select>
|
||||
@@ -48,8 +56,8 @@
|
||||
</select>
|
||||
|
||||
<insert id="insertBizDeliveryOrder" useGeneratedKeys="true" keyProperty="doId">
|
||||
INSERT INTO biz_delivery_order(tenant_id,do_no,rfq_id,quotation_id,supplier_id,total_amount,currency,delivery_date,delay_date,actual_close_date,close_date_set_by,delivery_status,remark,create_by,create_time)
|
||||
VALUES(#{tenantId},#{doNo},#{rfqId},#{quotationId},#{supplierId},#{totalAmount},#{currency},#{deliveryDate},#{delayDate},#{actualCloseDate},#{closeDateSetBy},#{deliveryStatus},#{remark},#{createBy},NOW())
|
||||
INSERT INTO biz_delivery_order(tenant_id,do_no,type,rfq_id,quotation_id,client_quote_id,supplier_id,total_amount,currency,delivery_date,delay_date,actual_close_date,close_date_set_by,delivery_status,remark,create_by,create_time)
|
||||
VALUES(#{tenantId},#{doNo},#{type},#{rfqId},#{quotationId},#{clientQuoteId},#{supplierId},#{totalAmount},#{currency},#{deliveryDate},#{delayDate},#{actualCloseDate},#{closeDateSetBy},#{deliveryStatus},#{remark},#{createBy},NOW())
|
||||
</insert>
|
||||
|
||||
<update id="updateBizDeliveryOrder">
|
||||
@@ -119,8 +127,9 @@
|
||||
<!-- 物料发货记录(多表JOIN追溯) -->
|
||||
<select id="selectMaterialRecords" resultType="java.util.Map">
|
||||
SELECT d.do_no,
|
||||
d.type,
|
||||
s.supplier_name,
|
||||
cl.client_name,
|
||||
COALESCE(cl.client_name, cq.client_name, cq2.client_name) AS client_name,
|
||||
di.quantity,
|
||||
di.unit_price,
|
||||
di.total_price,
|
||||
@@ -130,9 +139,12 @@
|
||||
FROM biz_delivery_order_item di
|
||||
JOIN biz_delivery_order d ON di.do_id = d.do_id
|
||||
LEFT JOIN biz_supplier s ON d.supplier_id = s.supplier_id
|
||||
-- 供应商履约链路: delivery → rfq → client_quote
|
||||
LEFT JOIN biz_rfq r ON d.rfq_id = r.rfq_id
|
||||
LEFT JOIN biz_client_quote cq ON r.client_quote_id = cq.quote_id
|
||||
LEFT JOIN biz_client cl ON cq.client_id = cl.client_id
|
||||
-- 甲方履约链路: delivery → client_quote(直连)
|
||||
LEFT JOIN biz_client_quote cq2 ON d.type = 'client' AND d.client_quote_id = cq2.quote_id
|
||||
LEFT JOIN biz_client cl ON COALESCE(cq.client_id, cq2.client_id) = cl.client_id
|
||||
WHERE di.material_id = #{materialId}
|
||||
ORDER BY d.create_time DESC
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user