1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
| package kingdee
|
| // 销售订单表
| type SEOrder struct {
| FBillNo string `gorm:"column:FBillNo" json:"FBillNo"` // 订单编号
| FNumber string `gorm:"column:FNumber" json:"FNumber"` // 产品代码
| FShortNumber string `gorm:"column:FShortNumber" json:"FShortNumber"` // 产品短代码, 客户图号
| FItemID string `gorm:"column:FItemID" json:"FItemID"` // 产品名称
| Fmodel string `gorm:"column:Fmodel" json:"Fmodel"` // 规格型号
| FUnitGroupID string `gorm:"column:FUnitGroupID" json:"FUnitGroupID"` // 基本单位
| FQty string `gorm:"column:FQty" json:"FQty"` // 基本单位数量
| FUnitID string `gorm:"column:FUnitID" json:"FUnitID"` // 单位
| Fauxqty float64 `gorm:"column:Fauxqty" json:"Fauxqty"` // 单位数量
| Fauxprice float64 `gorm:"column:Fauxprice" json:"Fauxprice"` // 单价
| Famount float64 `gorm:"column:Famount" json:"Famount"` // 金额
| FCess float64 `gorm:"column:FCess" json:"FCess"` // 税率
| FNote string `gorm:"column:FNote" json:"FNote"` // 备注
| FAdviceConsignDate string `gorm:"column:FAdviceConsignDate" json:"FAdviceConsignDate"` // 交货日期
| Fdate string `gorm:"column:Fdate" json:"Fdate"` // 订单日期
| FCustID string `gorm:"column:FCustID" json:"FCustID"` // 购货单位
| FInventory float64 `gorm:"column:FInventory" json:"FInventory"` // 即时库存
| // 含税单价
| // 物料属性
| // 存货科目代码
| }
|
| func SeOrderList() []SEOrder {
| sql := `
| SELECT
| i.FBillNo,
| i.FNumber,
| i.FShortNumber,
| i.FItemID,
| i.Fmodel,
| i.FUnitGroupID,
| i.FQty,
| i.FUnitID,
| i.Fauxqty,
| i.Fauxprice,
| i.Famount,
| i.FCess,
| i.FNote,
| i.FAdviceConsignDate,
| i.Fdate,
| i.FCustID,
| SUM(ICInventory.FQty) AS FInventory
| FROM
| vwICBill_32 AS i
| JOIN t_ICitem ON i.FShortNumber = t_ICitem.FShortNumber
| JOIN ICInventory ON ICInventory.FItemID = t_ICitem.FItemID
| WHERE
| DateDiff(dd,fDate,getdate())=0
| GROUP BY
| i.FBillNo,
| i.FNumber,
| i.FShortNumber,
| i.FItemID,
| i.Fmodel,
| i.FUnitGroupID,
| i.FQty,
| i.FUnitID,
| i.Fauxqty,
| i.Fauxprice,
| i.Famount,
| i.FCess,
| i.FNote,
| i.FAdviceConsignDate,
| i.Fdate,
| i.FCustID;
| `
|
| //查询当天日期
| //select * from vwICBill_32 where DateDiff(dd,fDate,getdate())=0
| var result []SEOrder
|
| db.Raw(sql).Scan(&result)
| //db.Raw(sql).Debug().Scan(&result)
|
| return result
| }
|
|