Explorar o código

合同报表增加入库量字段

zou.yingbin %!s(int64=4) %!d(string=hai) anos
pai
achega
cc5f49797a
Modificáronse 4 ficheiros con 61 adicións e 3 borrados
  1. 16 0
      docs/docs.go
  2. 16 0
      docs/swagger.json
  3. 12 0
      docs/swagger.yaml
  4. 17 3
      models/ermcpReport.go

+ 16 - 0
docs/docs.go

@@ -12696,6 +12696,10 @@ var doc = `{
                     "description": "所属机构T",
                     "type": "integer"
                 },
+                "buyinqty": {
+                    "description": "采购入库量",
+                    "type": "number"
+                },
                 "enumdicname": {
                     "description": "现货商品单位名称",
                     "type": "string"
@@ -12704,6 +12708,10 @@ var doc = `{
                     "description": "日照时期(yyyyMMdd)",
                     "type": "string"
                 },
+                "selloutqty": {
+                    "description": "销售出库量",
+                    "type": "number"
+                },
                 "todaybuyreckonqty": {
                     "description": "采购确定量",
                     "type": "number"
@@ -12741,6 +12749,10 @@ var doc = `{
                     "description": "所属机构T",
                     "type": "integer"
                 },
+                "buyinqty": {
+                    "description": "采购入库量",
+                    "type": "number"
+                },
                 "cycletime": {
                     "description": "周期时间 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】",
                     "type": "string"
@@ -12753,6 +12765,10 @@ var doc = `{
                     "description": "现货商品单位名称",
                     "type": "string"
                 },
+                "selloutqty": {
+                    "description": "销售出库量",
+                    "type": "number"
+                },
                 "todaybuyreckonqty": {
                     "description": "采购确定量",
                     "type": "number"

+ 16 - 0
docs/swagger.json

@@ -12680,6 +12680,10 @@
                     "description": "所属机构T",
                     "type": "integer"
                 },
+                "buyinqty": {
+                    "description": "采购入库量",
+                    "type": "number"
+                },
                 "enumdicname": {
                     "description": "现货商品单位名称",
                     "type": "string"
@@ -12688,6 +12692,10 @@
                     "description": "日照时期(yyyyMMdd)",
                     "type": "string"
                 },
+                "selloutqty": {
+                    "description": "销售出库量",
+                    "type": "number"
+                },
                 "todaybuyreckonqty": {
                     "description": "采购确定量",
                     "type": "number"
@@ -12725,6 +12733,10 @@
                     "description": "所属机构T",
                     "type": "integer"
                 },
+                "buyinqty": {
+                    "description": "采购入库量",
+                    "type": "number"
+                },
                 "cycletime": {
                     "description": "周期时间 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】",
                     "type": "string"
@@ -12737,6 +12749,10 @@
                     "description": "现货商品单位名称",
                     "type": "string"
                 },
+                "selloutqty": {
+                    "description": "销售出库量",
+                    "type": "number"
+                },
                 "todaybuyreckonqty": {
                     "description": "采购确定量",
                     "type": "number"

+ 12 - 0
docs/swagger.yaml

@@ -4280,12 +4280,18 @@ definitions:
       areauserid:
         description: 所属机构T
         type: integer
+      buyinqty:
+        description: 采购入库量
+        type: number
       enumdicname:
         description: 现货商品单位名称
         type: string
       reckondate:
         description: 日照时期(yyyyMMdd)
         type: string
+      selloutqty:
+        description: 销售出库量
+        type: number
       todaybuyreckonqty:
         description: 采购确定量
         type: number
@@ -4313,6 +4319,9 @@ definitions:
       areauserid:
         description: 所属机构T
         type: integer
+      buyinqty:
+        description: 采购入库量
+        type: number
       cycletime:
         description: 周期时间 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
         type: string
@@ -4322,6 +4331,9 @@ definitions:
       enumdicname:
         description: 现货商品单位名称
         type: string
+      selloutqty:
+        description: 销售出库量
+        type: number
       todaybuyreckonqty:
         description: 采购确定量
         type: number

+ 17 - 3
models/ermcpReport.go

@@ -402,6 +402,8 @@ type ErmcpReportDaySpot struct {
 	WRSTANDARDNAME     string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`         // 现货商品名称
 	WRSTANDARDCODE     string  `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`         // 现货商品代码
 	UNITID             int32   `json:"-"  xorm:"'UNITID'"`                              // 现货商品单位id
+	BUYINQTY           float64 `json:"buyinqty"  xorm:"'BUYINQTY'"`                     // 采购入库量
+	SELLOUTQTY         float64 `json:"selloutqty"  xorm:"'SELLOUTQTY'"`                 // 销售出库量
 
 	ENUMDICNAME        string  `json:"enumdicname"`        // 现货商品单位名称
 	TOTALBUYPRICEDQTY  float64 `json:"totalbuypricedqty"`  // 采购定价量 = 期末 - 期初
@@ -418,7 +420,8 @@ func (r *ErmcpReportDaySpot) Calc() {
 }
 
 func (r *ErmcpReportDaySpot) buildSql() string {
-	var sqlId utils.SQLVal = "select t.BUYPRICEDQTY," +
+	var sqlId utils.SQLVal = "select t.reckondate," +
+		"       t.BUYPRICEDQTY," +
 		"       t.SELLPRICEDQTY," +
 		"       t.Oribuypricedqty," +
 		"       t.Orisellpricedqty," +
@@ -429,8 +432,12 @@ func (r *ErmcpReportDaySpot) buildSql() string {
 		"       t.AREAUSERID," +
 		"       w.wrstandardname," +
 		"       w.wrstandardcode," +
-		"       w.unitid" +
+		"       w.unitid," +
+		"       s.todaybuyinqty      buyinqty," +
+		"       s.todayselloutqty    selloutqty" +
 		"  from RECKON_ERMCP_AREASPOT t" +
+		"  left join Reckon_ERMCP_AreaStock s" +
+		"    on t.reckondate = s.reckondate" +
 		"  left join wrstandard w" +
 		"    on t.wrstandardid = w.wrstandardid" +
 		" where 1 = 1"
@@ -479,6 +486,8 @@ type ErmcpReportMonSpot struct {
 	WRSTANDARDNAME     string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`         // 现货商品名称
 	WRSTANDARDCODE     string  `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`         // 现货商品代码
 	UNITID             int32   `json:"-"  xorm:"'UNITID'"`                              // 现货商品单位id
+	BUYINQTY           float64 `json:"buyinqty"  xorm:"'BUYINQTY'"`                     // 采购入库量
+	SELLOUTQTY         float64 `json:"selloutqty"  xorm:"'SELLOUTQTY'"`                 // 销售出库量
 
 	ENUMDICNAME        string  `json:"enumdicname"`        // 现货商品单位名称
 	TOTALBUYPRICEDQTY  float64 `json:"totalbuypricedqty"`  // 采购定价量 = 期末 - 期初
@@ -505,8 +514,13 @@ func (r *ErmcpReportMonSpot) buildSql() string {
 		"       t.AREAUSERID," +
 		"       w.wrstandardname," +
 		"       w.wrstandardcode," +
-		"       w.unitid" +
+		"       w.unitid," +
+		"       s.todaybuyinqty      buyinqty," +
+		"       s.todayselloutqty    selloutqty" +
 		"  from Report_ERMCP_AreaSpot t" +
+		"  left join Report_ERMCP_AreaStock s" +
+		"    on t.cycletime = s.cycletime" +
+		"   and t.cycletype = s.cycletype" +
 		"  left join wrstandard w" +
 		"    on t.wrstandardid = w.wrstandardid" +
 		" where t.cycletype = 1"