feat(bid): 完成招投标业务模块多需求迭代

本次提交包含多项功能改进与业务优化:
1.  全局主题色替换为#4A6FA5,统一前端UI风格
2.  新增客户报价单clientId字段,完善客户报价数据结构
3.  实现发货单状态流转功能,支持发货、完成、撤回、设置结单日期操作
4.  新增物料发货记录多表关联查询功能
5.  优化客户管理页面UI布局与交互体验
6.  修复客户报价表单自动补全逻辑,关联clientId与clientName
7.  补充租户ID自动填充逻辑,完善多租户数据隔离
This commit is contained in:
2026-06-10 20:47:14 +08:00
parent bbddcb494d
commit 93785be505
16 changed files with 671 additions and 727 deletions

View File

@@ -9,6 +9,7 @@ public class BizClientQuote extends BaseEntity {
private Long quoteId;
private Long tenantId;
private String quoteNo;
private Long clientId;
private String clientName;
private Long rfqId;
private String rfqNo;
@@ -29,6 +30,8 @@ public class BizClientQuote extends BaseEntity {
public void setTenantId(Long v){tenantId=v;}
public String getQuoteNo(){return quoteNo;}
public void setQuoteNo(String v){quoteNo=v;}
public Long getClientId(){return clientId;}
public void setClientId(Long v){clientId=v;}
public String getClientName(){return clientName;}
public void setClientName(String v){clientName=v;}
public Long getRfqId(){return rfqId;}

View File

@@ -1,7 +1,10 @@
package com.ruoyi.system.mapper.bid;
import com.ruoyi.system.domain.bid.BizDeliveryOrder;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface BizDeliveryOrderMapper {
List<BizDeliveryOrder> selectBizDeliveryOrderList(BizDeliveryOrder query);
@@ -10,4 +13,14 @@ public interface BizDeliveryOrderMapper {
int updateBizDeliveryOrder(BizDeliveryOrder record);
int deleteBizDeliveryOrderById(Long id);
int deleteBizDeliveryOrderByIds(Long[] ids);
// 状态流转直接更新不受动态SQL null判断影响
int updateDeliveryStatus(@Param("doId") Long doId,
@Param("deliveryStatus") String deliveryStatus,
@Param("delayDate") Date delayDate,
@Param("actualCloseDate") Date actualCloseDate,
@Param("closeDateSetBy") String closeDateSetBy);
// 物料发货记录
List<Map<String, Object>> selectMaterialRecords(@Param("materialId") Long materialId);
}

View File

@@ -2,6 +2,7 @@ package com.ruoyi.system.service.bid;
import com.ruoyi.system.domain.bid.BizDeliveryOrder;
import java.util.List;
import java.util.Map;
public interface IBizDeliveryOrderService {
List<BizDeliveryOrder> selectBizDeliveryOrderList(BizDeliveryOrder query);
@@ -10,4 +11,13 @@ public interface IBizDeliveryOrderService {
int updateBizDeliveryOrder(BizDeliveryOrder record);
int deleteBizDeliveryOrderById(Long id);
int deleteBizDeliveryOrderByIds(Long[] ids);
// 状态流转
int ship(Long id);
int complete(Long id, String username);
int recall(Long id);
int setCloseDate(Long id, String closeDate, String username);
// 物料发货记录
List<Map<String, Object>> selectMaterialRecords(Long materialId);
}

View File

@@ -12,6 +12,7 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class BizDeliveryOrderServiceImpl implements IBizDeliveryOrderService {
@@ -86,4 +87,57 @@ public class BizDeliveryOrderServiceImpl implements IBizDeliveryOrderService {
public int deleteBizDeliveryOrderByIds(Long[] ids) {
return mapper.deleteBizDeliveryOrderByIds(ids);
}
// ═══════════════════════════════════════════════
// 状态流转
// ═══════════════════════════════════════════════
@Override
@Transactional
public int ship(Long id) {
BizDeliveryOrder d = mapper.selectBizDeliveryOrderById(id);
if (d == null) throw new RuntimeException("发货单不存在");
if (!"pending".equals(d.getDeliveryStatus()))
throw new RuntimeException("当前状态不允许发货确认");
return mapper.updateDeliveryStatus(id, "transit", null, null, "");
}
@Override
@Transactional
public int complete(Long id, String username) {
BizDeliveryOrder d = mapper.selectBizDeliveryOrderById(id);
if (d == null) throw new RuntimeException("发货单不存在");
if (!"transit".equals(d.getDeliveryStatus()))
throw new RuntimeException("当前状态不允许收货完成");
return mapper.updateDeliveryStatus(id, "history", null, new java.sql.Date(System.currentTimeMillis()), username);
}
@Override
@Transactional
public int recall(Long id) {
BizDeliveryOrder d = mapper.selectBizDeliveryOrderById(id);
if (d == null) throw new RuntimeException("发货单不存在");
if (!"transit".equals(d.getDeliveryStatus()) && !"history".equals(d.getDeliveryStatus()))
throw new RuntimeException("当前状态不允许撤回");
return mapper.updateDeliveryStatus(id, "pending", null, null, "");
}
@Override
@Transactional
public int setCloseDate(Long id, String closeDate, String username) {
if (closeDate == null || closeDate.isEmpty()) {
return mapper.updateDeliveryStatus(id, null, null, null, "");
} else {
return mapper.updateDeliveryStatus(id, null, null, java.sql.Date.valueOf(closeDate), username);
}
}
// ═══════════════════════════════════════════════
// 物料发货记录
// ═══════════════════════════════════════════════
@Override
public List<Map<String, Object>> selectMaterialRecords(Long materialId) {
return mapper.selectMaterialRecords(materialId);
}
}

View File

@@ -7,7 +7,8 @@
<sql id="quoteColumns">
quote_id AS quoteId, tenant_id AS tenantId, quote_no AS quoteNo,
client_name AS clientName, rfq_id AS rfqId, rfq_no AS rfqNo, rfq_title AS rfqTitle,
client_id AS clientId, client_name AS clientName,
rfq_id AS rfqId, rfq_no AS rfqNo, rfq_title AS rfqTitle,
status, validity_date AS validityDate, total_amount AS totalAmount,
currency, remark, create_by AS createBy, create_time AS createTime
</sql>
@@ -54,9 +55,9 @@
</select>
<insert id="insertClientQuote" useGeneratedKeys="true" keyProperty="quoteId">
INSERT INTO biz_client_quote (tenant_id,quote_no,client_name,rfq_id,rfq_no,rfq_title,
INSERT INTO biz_client_quote (tenant_id,quote_no,client_id,client_name,rfq_id,rfq_no,rfq_title,
status,validity_date,total_amount,currency,remark,create_by,create_time)
VALUES (1,#{quoteNo},#{clientName},#{rfqId},#{rfqNo},#{rfqTitle},
VALUES (1,#{quoteNo},#{clientId},#{clientName},#{rfqId},#{rfqNo},#{rfqTitle},
#{status},#{validityDate},#{totalAmount},#{currency},#{remark},#{createBy},NOW())
</insert>
@@ -68,7 +69,7 @@
</insert>
<update id="updateClientQuote">
UPDATE biz_client_quote SET client_name=#{clientName},status=#{status},
UPDATE biz_client_quote SET client_id=#{clientId},client_name=#{clientName},status=#{status},
validity_date=#{validityDate},total_amount=#{totalAmount},
currency=#{currency},remark=#{remark},update_time=NOW()
WHERE quote_id=#{quoteId}

View File

@@ -73,4 +73,36 @@
DELETE FROM biz_delivery_order WHERE do_id IN
<foreach collection="array" item="id" open="(" separator="," close=")">#{id}</foreach>
</delete>
<!-- 状态流转更新直接设置字段不受动态SQL null判断影响 -->
<update id="updateDeliveryStatus">
UPDATE biz_delivery_order
SET delivery_status=#{deliveryStatus},
delay_date=#{delayDate},
actual_close_date=#{actualCloseDate},
close_date_set_by=#{closeDateSetBy},
update_time=NOW()
WHERE do_id=#{doId}
</update>
<!-- 物料发货记录多表JOIN追溯 -->
<select id="selectMaterialRecords" resultType="java.util.Map">
SELECT d.do_no,
s.supplier_name,
cl.client_name,
di.quantity,
di.unit_price,
di.total_price,
d.delivery_date,
d.actual_close_date,
d.delivery_status
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
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
WHERE di.material_id = #{materialId}
ORDER BY d.create_time DESC
</select>
</mapper>