Browse Source

fix(orders): 修复OrderGoods实体supplierId类型不匹配问题

- 将OrderGoods实体中的supplierId字段改为nullable
- 修复order.service.ts中的类型错误
- 确保类型检查和构建通过

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
yourname 4 weeks ago
parent
commit
b703c56e2f

+ 2 - 2
packages/server/src/modules/orders/order-goods.entity.ts

@@ -24,8 +24,8 @@ export class OrderGoods {
   @Column({ name: 'goods_type', type: 'int', default: 1, comment: '1实物产品2虚拟订单' })
   goodsType!: number;
 
-  @Column({ name: 'supplier_id', type: 'int', unsigned: true, default: 0, comment: '供货商id' })
-  supplierId!: number;
+  @Column({ name: 'supplier_id', type: 'int', unsigned: true, nullable: true, comment: '供货商id' })
+  supplierId!: number | null;
 
   @Column({ name: 'cost_price', type: 'decimal', precision: 10, scale: 2, default: 0.00, comment: '成本价' })
   costPrice!: number;

+ 3 - 1
packages/server/src/modules/orders/order.service.ts

@@ -129,7 +129,9 @@ export class OrderService extends GenericCrudService<Order> {
         freightAmount: 0,
         state: 0,
         createdBy: userId,
-        updatedBy: userId
+        updatedBy: userId,
+        expressName: null,
+        expressNo: null
       }));
 
       await queryRunner.manager.save(OrderGoods, orderGoodsList);